$MyInvocation.MyCommand.Path is $null in PowerGUI script editor

Posted by Polymorphix on Stack Overflow See other posts from Stack Overflow or by Polymorphix
Published on 2010-06-07T11:37:13Z Indexed on 2010/06/07 11:42 UTC
Read the original article Hit count: 777

When trying to debug my powershell script in the powerGUI script editor (2.0.0.1082) the $MyInvocation.MyCommand.Path is $null. It works when running the script via powershell. Running it in Powershell_ise.exe (on one of our servers) also works fine.

Have anyone else had the same problem or know what's wrong?

Here's the my powershell version:

Name                           Value
----                           -----
CLRVersion                     2.0.50727.4927
BuildVersion                   6.1.7600.16385
PSVersion                      2.0
WSManStackVersion              2.0
PSCompatibleVersions           {1.0, 2.0}
SerializationVersion           1.1.0.1
PSRemotingProtocolVersion      2.1

Server version:

Name                           Value
----                           -----
CLRVersion                     2.0.50727.3082
BuildVersion                   6.0.6002.18111
PSVersion                      2.0
WSManStackVersion              2.0
PSCompatibleVersions           {1.0, 2.0}
SerializationVersion           1.1.0.1
PSRemotingProtocolVersion      2.1

© Stack Overflow or respective owner

Related posts about powershell

Related posts about powershell-v2.0