[windows] Add dynamic path for Get-ToolsetContent (#9147)

* [windows] Add dynamic path for Get-ToolsetContent

* Add missing variable in win22 template
This commit is contained in:
Shamil Mubarakshin
2024-01-12 12:31:21 +01:00
committed by GitHub
parent cb77fa2a64
commit ebef5f5fee
3 changed files with 40 additions and 19 deletions

View File

@@ -217,11 +217,11 @@ function Get-ToolsetContent {
Retrieves the content of the toolset.json file.
.DESCRIPTION
This function reads the toolset.json file located at "C:\image\toolset.json"
and returns the content as a PowerShell object.
This function reads the toolset.json file in path provided by IMAGE_FOLDER
environment variable and returns the content as a PowerShell object.
#>
$toolsetPath = Join-Path "C:\\image" "toolset.json"
$toolsetPath = Join-Path $env:IMAGE_FOLDER "toolset.json"
$toolsetJson = Get-Content -Path $toolsetPath -Raw
ConvertFrom-Json -InputObject $toolsetJson
}