Misc/Get-Pfx.ps1
function Get-PfxFile { Param( [Parameter(Mandatory = $true)] $Publisher ) switch ($Publisher.ToUpper()) { "DTX" { $PfxFile = Get-Secret -vaultName "NAV-X" -secretName "DtxCodeSignPfxFile" break } "NAV-X" { $PfxFile = Get-Secret -vaultName "NAV-X" -secretName "CodeSignPfxFile" break } "Clients First Business Solutions" { $PfxFile = Get-Secret -vaultName "NAV-X" -secretName "CfbsCodeSignPfxFile" break } default { $PfxFile = "" break } } $PfxFile } function Get-PfxPassword { Param( [Parameter(Mandatory = $true)] $Publisher ) switch ($Publisher.ToUpper()) { "DTX" { $PfxPassword = Get-Secret -vaultName "NAV-X" -secretName "DtxCodeSignPfxPassword" break } "NAV-X" { $PfxPassword = Get-Secret -vaultName "NAV-X" -secretName "CodeSignPfxPassword" break } "Clients First Business Solutions" { $PfxPassword = Get-Secret -vaultName "NAV-X" -secretName "CfbsCodeSignPfxPassword" break } default { $PfxPassword = "" break } } (ConvertTo-SecureString $PfxPassword -AsPlainText -Force) } |