Misc/Get-LicenseFile.ps1
function Get-LicenseFile { Param( [Parameter(Mandatory = $true)] $Publisher, [Parameter(Mandatory = $true)] $Version, [Parameter(Mandatory = $false)] $Settings = $null ) if ($null -eq $Settings) { $Settings = Import-Config } switch ($Publisher.ToUpper()) { "DTX" { $LicenseFile = Get-Secret -secretName "DtxLicenseFile" break } "NAV-X" { if ($Version -eq 11 -or $Version -eq 2018) { $LicenseFile = Get-Secret -secretName "LicenseFileNAV2018" } else { if ($Version -le 10 -or $Version -ge 2016) { $LicenseFile = Get-Secret -secretName "LicenseFileNAV" } else { $LicenseFile = Get-Secret -secretName "LicenseFile" } } break } "Clients First Business Solutions" { $LicenseFile = Get-Secret -secretName "CfbsLicenseFile" break } default { $LicenseFile = "" break } } $LicenseFile } |