How to run a Powershell script from C# that references another script -
i'm trying run powershell script c# program so:
var ps = powershell.create(); ps.addscript(@"<full-path-to-script>.ps1").invoke()
but fails because within script references script gives me error saying it's not found. however, running script commandline works fine. i'm not sure understand why not working within c# works in commandline. ideas?
probably have different working directories. how line inside <full-path-to-script>.ps1
includes second script? should use $psscriptroot
.
Comments
Post a Comment