Skip to content

Commit

Permalink
Improve PowerShell detection logic in baseline update script (#15522)
Browse files Browse the repository at this point in the history
I did some more digging as this wasn't working on my Windows machine. I
figured out the specific PowerShell version that triggered the change,
and made the detection more accurate.
  • Loading branch information
anthony-c-martin authored Nov 8, 2024
1 parent 4061eef commit 99579a9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scripts/UpdateBaselines.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
if (($PSVersionTable.Keys -contains "PSEdition") -and ($PSVersionTable.PSEdition -ne 'Desktop')) {
# PowerShell Core
# https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parsing#passing-arguments-that-contain-quote-characters
if ($PSVersionTable.PSVersion -ge [System.Version]"7.3") {
dotnet test --filter "TestCategory=Baseline" -- 'TestRunParameters.Parameter(name="SetBaseLine", value="true")'
} else {
# PowerShell Desktop
dotnet test --filter "TestCategory=Baseline" -- 'TestRunParameters.Parameter(name=\"SetBaseLine\", value=\"true\")'
}

0 comments on commit 99579a9

Please sign in to comment.