【发布时间】:2020-08-21 04:22:47
【问题描述】:
你好,我正在做一个小脚本,它将使用Add-MpPreference 运行一个小型 powershell。就我而言,我这样做是因为有时我想在我的 Windows 10 中包含一些路径,但我必须手动完成。所以我试图让它自动化。我这样做了:
ShellExecute("powershell", '-noexit Add-MpPreference -ExclusionPath C:/')
错误返回是我:
The term 'Add-MpPreference' is not recognized as the name of a cmdlet, function
, script file, or operable program. Check the spelling of the name, or if a pat
h was included, verify that the path is correct and try again.
At line:1 char:17
+ Add-MpPreference <<<< -ExclusionPath C:/
+ CategoryInfo : ObjectNotFound: (Add-MpPreference:String) [], Co
mmandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
这个错误是什么意思?还是可以修?
【问题讨论】:
标签: powershell