mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Correct case of $MyInvocation special variable
This commit is contained in:
@@ -137,7 +137,7 @@ Describe "Assign automatic variables" -Tags "CI" {
|
||||
& { [object]$this = 1; $this } | Should -Be 1
|
||||
& { [object]$input = 1; $input } | Should -Be 1
|
||||
# Can't test PSCmdlet or PSBoundParameters, they use an internal type
|
||||
& { [System.Management.Automation.InvocationInfo]$myInvocation = $myInvocation; $myInvocation.Line } | Should -Match Automation.InvocationInfo
|
||||
& { [System.Management.Automation.InvocationInfo]$MyInvocation = $MyInvocation; $MyInvocation.Line } | Should -Match Automation.InvocationInfo
|
||||
& { [string]$PSScriptRoot = 'abc'; $PSScriptRoot } | Should -BeExactly 'abc'
|
||||
& { [string]$PSCommandPath = 'abc'; $PSCommandPath } | Should -BeExactly 'abc'
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ Describe 'Test for conversion b/w script block and delegate' -Tags "CI" {
|
||||
BeforeAll {
|
||||
function lineno
|
||||
{
|
||||
$myInvocation.ScriptLineNumber
|
||||
$MyInvocation.ScriptLineNumber
|
||||
}
|
||||
|
||||
function Generate-ArgumentTypesAndParameters
|
||||
|
||||
@@ -857,7 +857,7 @@ try
|
||||
$ipaddress
|
||||
)
|
||||
|
||||
"Bound parameter: $($myInvocation.BoundParameters.Keys | Sort-Object)"
|
||||
"Bound parameter: $($MyInvocation.BoundParameters.Keys | Sort-Object)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -898,7 +898,7 @@ try
|
||||
$ipaddress
|
||||
)
|
||||
|
||||
"Bound parameter: $($myInvocation.BoundParameters.Keys)"
|
||||
"Bound parameter: $($MyInvocation.BoundParameters.Keys)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -939,7 +939,7 @@ try
|
||||
$ipaddress
|
||||
)
|
||||
|
||||
"Bound parameter: $($myInvocation.BoundParameters.Keys | Sort-Object)"
|
||||
"Bound parameter: $($MyInvocation.BoundParameters.Keys | Sort-Object)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -990,7 +990,7 @@ try
|
||||
$PriorityClass
|
||||
)
|
||||
|
||||
"Bound parameter: $($myInvocation.BoundParameters.Keys | Sort-Object)"
|
||||
"Bound parameter: $($MyInvocation.BoundParameters.Keys | Sort-Object)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1036,7 +1036,7 @@ try
|
||||
$ipaddress
|
||||
)
|
||||
|
||||
"Bound parameter: $($myInvocation.BoundParameters.Keys | Sort-Object)"
|
||||
"Bound parameter: $($MyInvocation.BoundParameters.Keys | Sort-Object)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user