我尝试通过 Visual Studio .NET 调用 Windows Powershell cmdlet。但是,当我尝试调用函数时,出现如下所示的异常。Microsoft.PowerShell.ConsoleHost.dll最初并不位于该路径中,因此我从另一个位置复制了它。这是安装管理单元的正确方法吗?它仍然会抛出该异常,我不知道为什么。任何朝着正确方向的推动都会非常有帮助。谢谢。
System.Management.Automation.Runspaces.PSSnapInException:无法加载 Windows PowerShell 管理单元 Microsoft.PowerShell.Host,因为出现以下错误:无法加载文件或程序集“ file:///C:\Windows\System32\WindowsPowerShell\v1” .0\Microsoft.PowerShell.ConsoleHost.dll ' 或其依赖项之一。该系统找不到指定的文件。System.Management.Automation.Runspaces.PSSnapInException:在System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadMshSnapinAssembly(PSSnapInInfo mshsnapinInfo)在System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.LoadPSSnapIn(PSSnapInInfo mshsnapinInfo)在System.Management.Automation.Runspaces .RunspaceConfigForSingleShell.LoadPSSnapIns(Collection`1 mshsnapinInfos,PSConsoleLoadException&警告)在System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.CreateDefaultConfiguration()在System.Management.Automation.Runspaces.RunspaceConfiguration.Create()
| 归档时间: |
|
| 查看次数: |
3526 次 |
| 最近记录: |