Hello i am doing a small script will run a small powershell using Add-MpPreference
. In my case, i was doing because sometimes i want to include some path's in my windows 10 but i must to do manually. So i was trying to make it automatic. I did this:
ShellExecute("powershell", '-noexit Add-MpPreference -ExclusionPath C:/')
Error return's me:
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
What mean's this error? Or can be fixed?