diff --git a/build.psm1 b/build.psm1 index c9bdf4c689..913fbe35bc 100644 --- a/build.psm1 +++ b/build.psm1 @@ -2385,7 +2385,7 @@ function Copy-PSGalleryModules $cache = dotnet nuget locals global-packages -l if ($cache -match "info : global-packages: (.*)") { - $nugetCache = $matches[1] + $nugetCache = $Matches[1] } else { throw "Can't find nuget global cache" @@ -2400,7 +2400,7 @@ function Copy-PSGalleryModules # Remove the build revision from the src (nuget drops it). $srcVer = if ($version -match "(\d+.\d+.\d+).0") { - $matches[1] + $Matches[1] } elseif ($version -match "^\d+.\d+$") { # Two digit versions are stored as three digit versions "$version.0" diff --git a/demos/rest/rest.ps1 b/demos/rest/rest.ps1 index db9867e8d2..3f2364f950 100644 --- a/demos/rest/rest.ps1 +++ b/demos/rest/rest.ps1 @@ -24,7 +24,7 @@ function Get-Issue { if ($link -match '\s*<(.*)>;\s+rel="next"') { - $uri = $matches[1] + $uri = $Matches[1] } } } diff --git a/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 index 3b3dbd6481..7bb841711e 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 @@ -228,7 +228,7 @@ Describe 'Positive Parse Properties Tests' -Tags "CI" { $lastexitcode '111' -Match '1' $Matches - $mAtches + $Matches $Error[0] $error $pwd diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeUnixGlobbing.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeUnixGlobbing.Tests.ps1 index e6d313e5cb..5176056fe5 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeUnixGlobbing.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeUnixGlobbing.Tests.ps1 @@ -50,9 +50,9 @@ Describe 'Native UNIX globbing tests' -tags "CI" { } # Test globbing with absolute paths - it shouldn't turn absolute paths into relative paths (#7089) It 'Should not normalize absolute paths' { - $matches = /bin/echo /etc/* + $Matches = /bin/echo /etc/* # Matched path should start with '/etc/' not '../..' - $matches.substring(0,5) | Should -Be '/etc/' + $Matches.substring(0,5) | Should -Be '/etc/' } It 'Globbing should not happen with quoted expressions' { $v = "$TESTDRIVE/abc*" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 index 4954bcff04..2047337c84 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 @@ -515,7 +515,7 @@ Describe "PSModulePath changes interacting with other PowerShell processes" -Tag It "Does not duplicate the System32 module path in subprocesses" { $sys32ModPathCount = & $pwsh -C { - & "$PSHOME/pwsh" -C '$null = $env:PSModulePath -match ([regex]::Escape((Join-Path $env:windir "System32" "WindowsPowerShell" "v1.0" "Modules"))); $matches.Count' + & "$PSHOME/pwsh" -C '$null = $env:PSModulePath -match ([regex]::Escape((Join-Path $env:windir "System32" "WindowsPowerShell" "v1.0" "Modules"))); $Matches.Count' } $sys32ModPathCount | Should -Be 1 diff --git a/test/tools/Modules/HttpListener/HttpListener.psm1 b/test/tools/Modules/HttpListener/HttpListener.psm1 index 3c8dc4bb32..a3e83ce45d 100644 --- a/test/tools/Modules/HttpListener/HttpListener.psm1 +++ b/test/tools/Modules/HttpListener/HttpListener.psm1 @@ -69,8 +69,8 @@ Function Start-HTTPListener { { if ($segment -match "\??(?\w*)(=(?.*?))?$") { - $name = $matches["name"] - $value = $matches["value"] + $name = $Matches["name"] + $value = $Matches["value"] if ($null -ne $value) { $value = [System.Web.HttpUtility]::UrlDecode($value) diff --git a/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 b/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 index b5d932d5c3..8a2d98f473 100644 --- a/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 +++ b/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 @@ -124,7 +124,7 @@ function NormalizeVersion { param ([string] $version) $sVer = if ($version -match "(\d+.\d+.\d+).0") { - $matches[1] + $Matches[1] } elseif ($version -match "^\d+.\d+$") { # Two digit versions are stored as three digit versions "$version.0"