I am writing C # Cmdlet which needs to get the value of a script global variable. How to do it?
I noticed that Runspace has a SessionStateProxy.GetVariable method. Can I access a workspace from C # Cmdlet?
Thanks!
If you are using PSCmdlet, use the this variable to access it as follows:
this
this.SessionState.PSVariable.GetValue()