How does a C# runspace/pipeline execute a powershell script? -
there many questions , answers how execute powershell script c# code, know how runspace/pipeline performs execution of .ps1 file.
the context in asking this: i've built basic asp.net front end powershell script sets new website. creates site in iis , sets wwwroot folders, log folders, ad user , else needs. works when run admin in powershell. however, when run through c# pipeline, breaks pipe parameter binding exception.
i'm not after answer specific problem, i'm looking explanation of how pipeline executes file can have better understanding of going on.
have tried using ilspy or opening class in class view see code class? time see how microsoft implements particular class. paste code here if short answer, there lot system.management.automation.runspaces or microsoft.powershell namespaces. take yourself, , able see how microsoft implements execution of powershell scripts.
hope helps.
Comments
Post a Comment