Forum Discussion
Hellarpk
Aug 09, 2023Former Employee
Power shell Command
I trying to run this command in PowerShell
Get-AppLockerPolicy -Effective | Test-AppLockerPolicy -User $env:USERNAME -path “C:\path to file” I am not sure what to edit in the path location....
LainRobertson
Aug 09, 2023Silver Contributor
It would be useful if you could provide the full command you're running as well as the error you're receiving, as all we can do until then is guess.
The -Path parameter takes an array of strings where each string should be the full path to an application or script
Here's a a working example of Test-AppLockerPolicy:
Get-AppLockerPolicy -Effective |
Test-AppLockerPolicy -User Everyone -Path @(
"C:\Windows\notepad.exe";
"D:\Data\Git-2.38.1-64-bit.exe";
);
And here's two examples in action. The first tests against the Everyone security principal while the second targets a specific user account:
Cheers,
Lain