You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unix: A script without .ps1 extension passed to the powershell binary lacks invocation information ($PSCommandPath, $MyInvocation), such as when invoked via a shebang line. #4217
Steps to reproduce
Create file
./t- note the absence of extension.ps1- with the content below and make it executable (chmod +x ./t).Both the following invocation methods, from
bash, yield the behavior described below:Expected behavior
$PSCommandPathand$MyInvocation.MyCommand.Pathshould reflect the script's file path, and$MyInvocationshould be populated appropriately.Actual behavior
Environment data