Hello everyone, I'm having some troubles with embedding PowerShell script into C# code using Visual ...
Hello everyone, I'm having some troubles with embedding PowerShell script into C# code using Visual Studio. PowerShell library has been added to the solution, and all works fine when I call (from C# code) simple commands like "date", "echo" and also when I have declaration of variables. Troubles arise when I use PowerShell commands for open a SharePoint website. The PowerShell command works finely if executed from the console, but not when called from C# code. I've tried to change the Visual Studio solution target framework, but the problem still persists. Any suggestion about that is really appreciated !!!

Answers
Know the answer? Post it. Somebody with the same question will find it here.