I am teaching myself C# by building a PowerShell module. I want to retrieve the PSScriptRoot property from the InvocationInfo class but it appears to be something that is called indirectly. Does anyone have guidance on a) how to invoke it or b) how to use it to spit out the script root?
I need to do scaffolding in code. To do this I wrote this method;
public string RunScript(string scriptText)
string dir = @"C:\Users\demetsen\source\repos\ScaffoldingInCode\ScaffoldingInCode";