InvocationInfo.PSScriptRoot Property   
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
This property tells you the directory from where you were being invoked.
public:
 property System::String ^ PSScriptRoot { System::String ^ get(); };public:
 property Platform::String ^ PSScriptRoot { Platform::String ^ get(); };public string PSScriptRoot { get; }member this.PSScriptRoot : stringPublic ReadOnly Property PSScriptRoot As String