mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Correct case of $Matches special variable
This commit is contained in:
@@ -228,7 +228,7 @@ Describe 'Positive Parse Properties Tests' -Tags "CI" {
|
||||
$lastexitcode
|
||||
'111' -Match '1'
|
||||
$Matches
|
||||
$mAtches
|
||||
$Matches
|
||||
$Error[0]
|
||||
$error
|
||||
$pwd
|
||||
|
||||
@@ -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*"
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
@@ -69,8 +69,8 @@ Function Start-HTTPListener {
|
||||
{
|
||||
if ($segment -match "\??(?<name>\w*)(=(?<value>.*?))?$")
|
||||
{
|
||||
$name = $matches["name"]
|
||||
$value = $matches["value"]
|
||||
$name = $Matches["name"]
|
||||
$value = $Matches["value"]
|
||||
if ($null -ne $value)
|
||||
{
|
||||
$value = [System.Web.HttpUtility]::UrlDecode($value)
|
||||
|
||||
Reference in New Issue
Block a user