clr - Cannot load Windows PowerShell snap-in Microsoft.PowerShell.Host -


I am trying to open Windows PowerShell cmdlets through Visual Studio .NET. However, when I try to call a function, I get the exception shown below. Microsoft.PowerShell.ConsoleHost.dll was not in the initial route, so I copied it from another location Is this the right way to install a snap-in? It still excludes that exception and I'm not sure why any guide in the right direction is very helpful thanks.

System.Management.Automation.Runspaces.PSSnapInException: Windows PowerShell snap-in can not be loaded due to the following error: The file or the assembly could not be loaded by the ' File: / / C: \ WindowsSystem32 \ WindowsPowerShell \ v1.0.Microsoft.PowerShell.ConsoleHost.dll 'or its dependency failed to detect the specified file. System.Management.Automation.Runspaces.PSSnapInException: System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadPSSnapIn (PSSnapInInfo mshsnapinInfo) on System.Management.Automation.Runspaces on System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadMshSnapinAssembly (PSSnapInInfo mshsnapinInfo) . In the system In the system Management. Automation. Rain spaces. Ranspace configuration. Create ()

. To manage the system. Redirection. (1) MSSAPINSIISI (SDI)

Try to use the equipment provided by MS This helps in problems when something The assemblies can not be loaded.


Comments