Steps to reproduce
PS> cat .\about.ps1
$Test = 1;
switch ($NeverUsedBefore[0]) {
"a" {};
}
Expected behavior
Run about.ps1 reports the correct script location.
PS> .\about.ps1
Cannot index into a null array.
At F:\tmp\about.ps1:2 char:9
+ switch ($NeverUsedBefore[0]) {
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray
Actual behavior
Run about.ps1 reports the wrong script location.
PS> .\about.ps1
Cannot index into a null array.
At F:\tmp\about.ps1:1 char:1
+ $Test = 1;
+ ~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.0.1
PSEdition Core
GitCommitId v6.0.1
OS Microsoft Windows 10.0.17134
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Steps to reproduce
Expected behavior
Run
about.ps1reports the correct script location.Actual behavior
Run
about.ps1reports the wrong script location.Environment data