调用Enable-PSRemoting时缺失pwrshplugin.dll的问题排查
执行PowerShell远程命令时缺失pwrshplugin.dll的问题
我在一个涉及PSRemoting的项目中执行以下C#代码:
ps.AddScript("enable-psremoting -force -skipnetworkprofilecheck"); await ps.InvokeAsync();
触发了如下错误:
System.Management.Automation.ActionPreferenceStopException: 'The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\Users\pa3ck\Desktop\MP\RemotePowerShell\RemotePowershell\bin\Debug\net6.0- windows\runtimes\win\lib\net6.0\pwrshplugin.dll' because it does not exist.'
我推测是缺少某个NuGet包,但无法确定具体是哪一个。当前项目已安装并启用以下NuGet包:
- Microsoft.PowerShell.SDK (7.2.7)
- Microsoft.WSMan.Management (7.2.7)
- Microsoft.WSMan.Runtime (7.2.7)
- System.Management.Automation (7.2.7)
内容的提问来源于stack exchange,提问作者Pa3ckP7
相关产品推荐
相关产品推荐

