File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
pipelines/templates/steps Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1313 workingDirectory : $(System.DefaultWorkingDirectory)
1414 filePath : ${{ parameters.ScriptDirectory }}/Verify-AgentOS.ps1
1515 arguments : >
16- -AgentImage ${{ parameters.AgentImage }}
16+ -AgentImage " ${{ parameters.AgentImage }}"
Original file line number Diff line number Diff line change @@ -8,6 +8,14 @@ function Throw-InvalidOperatingSystem {
88 throw " Invalid operating system detected. Operating system was: $ ( [System.Runtime.InteropServices.RuntimeInformation ]::OSDescription) , expected image was: $AgentImage "
99}
1010
11- if ($AgentImage -match " windows|win|MMS2019" -and ! $IsWindows ) { Throw - InvalidOperatingSystem }
12- if ($AgentImage -match " ubuntu" -and ! $IsLinux ) { Throw - InvalidOperatingSystem }
13- if ($AgentImage -match " macos" -and ! $IsMacOs ) { Throw - InvalidOperatingSystem }
11+ if ($IsWindows -and $AgentImage -match " windows|win|MMS2019" ) {
12+ $osName = " Windows"
13+ } elseif ($IsLinux -and $AgentImage -match " ubuntu" ) {
14+ $osName = " Linux"
15+ } elseif ($IsMacOs -and $AgentImage -match " macos" ) {
16+ $osName = " macOS"
17+ } else {
18+ Throw - InvalidOperatingSystem
19+ }
20+
21+ Write-Host " ##vso[task.setvariable variable=OSName]$osName "
You can’t perform that action at this time.
0 commit comments