There are so many questions and answers about how to execute a powershell script from C# code, but I would like to know how exactly the runspace/pipeline performs the execution of the .ps1 file.
The context in which I am asking is this: I've built a basic asp.net front end for a powershell script that sets up a new website. It creates the site in IIS and sets up wwwroot folders, log folders, an AD user and everything else that it needs. It works perfectly when I run it as an admin in powershell. However, when I run it through my C# pipeline, it breaks the pipe with a parameter binding exception.
I'm not after an answer to this specific problem, I'm just looking for an explanation of how the pipeline executes my file so that I can have a better understanding of what exactly is going on.