Skip to content

Commit

Permalink
Including ProductKeys in nupkg (#1254)
Browse files Browse the repository at this point in the history
* Including ProductKeys in nupkg

* Fix termin. error in Get-LabAvailableOs
  • Loading branch information
nyanhp committed Jan 21, 2022
1 parent 4822def commit 551a92b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .build/beforebuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if (-not $IsLinux)
}

Write-Host "'before_build' block"
Copy-Item -Path (Join-Path -Path $env:APPVEYOR_BUILD_FOLDER 'Assets/ProductKeys.xml') -Destination (Join-Path -Path $env:APPVEYOR_BUILD_FOLDER 'AutomatedLab/ProductKeys.xml')

Write-Host "Setting version number in files"
Add-AppveyorMessage -Message "Setting version number in files" -Category Information
Expand Down
4 changes: 4 additions & 0 deletions AutomatedLab/AutomatedLab.init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,10 @@ Set-PSFConfig -Module AutomatedLab -Name ValidationSettings -Value @{
# Product key file path
$fPath = Join-Path -Path (Get-PSFConfigValue -FullName AutomatedLab.LabAppDataRoot) -ChildPath 'Assets/ProductKeys.xml'
$fcPath = Join-Path -Path (Get-PSFConfigValue -FullName AutomatedLab.LabAppDataRoot) -ChildPath 'Assets/ProductKeysCustom.xml'
if (-not (Test-Path -Path $fPath -ErrorAction SilentlyContinue))
{
Copy-Item -Path "$PSScriptRoot/ProductKeys.xml" -Destination $fcPath -Force -ErrorAction SilentlyContinue
}
Set-PSFConfig -Module AutomatedLab -Name ProductKeyFilePath -Value $fPath -Initialize -Validation string -Description 'Destination of the ProductKeys file for Windows products'
Set-PSFConfig -Module AutomatedLab -Name ProductKeyFilePathCustom -Value $fcPath -Initialize -Validation string -Description 'Destination of the ProductKeysCustom file for Windows products'

Expand Down
2 changes: 1 addition & 1 deletion AutomatedLab/AutomatedLab.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,7 @@ function Get-LabAvailableOperatingSystem
}
else
{
$cachedSkus = $type::ImportFromRegistry('Cache', "$($storeLocationName)OperatingSystems")
$cachedSkus = try { $type::ImportFromRegistry('Cache', "$($storeLocationName)OperatingSystems") } catch { }
}

$type = Get-Type -GenericType AutomatedLab.ListXmlStore -T AutomatedLab.OperatingSystem
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- Fixed issue with AutomatedLab.Ships where folder browsing would not work

- CustomRole does not pick up configured properties
- Including ProductKeys file in module build for offline environments

## 5.40.0 (2021-10-13)

Expand Down

0 comments on commit 551a92b

Please sign in to comment.