I have a wcf service. And I am running some cmdlets as below
Runspace runspace = RunspaceFactory.CreateRunspace(); // open it runspace.Open(); Pipeline pipeline = runspace.CreatePipeline(); RunspaceInvoke scriptInvoker = new RunspaceInvoke(runspace); Command myCommand = new Command("Import-Module"); myCommand.Parameters.Add("Name", "virtualmachinemanager"); ........
I have hosted this service on a machine with credentials MYDOM/user1. And from here It runs. but when I Call this service with other credentials say MYDOM/Administrator it gives error message "An error occurred when loading the system Windows PowerShell
Snap-Ins. Please contact Microsoft Support Services."