You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

调用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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.13 11:20:33