您好,我正在做一个小的脚本,它将使用来运行一个小的powershell Add-MpPreference。就我而言,我这样做是因为有时我想在Windows 10中包含一些路径,但是我必须手动执行。所以我试图使其自动化。我这样做:
ShellExecute("powershell", '-noexit Add-MpPreference -ExclusionPath C:/')
Run Code Online (Sandbox Code Playgroud)
错误返回是我:
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
Run Code Online (Sandbox Code Playgroud)
这是什么意思?还是可以解决?
powershell ×1