I am developing PowerShell 3.0 cmdlet using C # /. NET 4.0 in Visual Studio 2010. I want to get the current directory in PowerShell, where the user runs cmdlet . But Directory.GetCurrentDirectory () is not working properly. In the code below, the result is C: \ Users \ Administrator.
Question: What cmdlet code is used to get the current PowerShell directory?
[System.Management.Automation.Cmdlet(System.Management.Automation.VerbsCommon.Get, "StatusBar")] public class GetStatusBarCommand : System.Management.Automation.PSCmdlet {
source share