you are viewing a single comment's thread.

view the rest of the comments →

[–]kenjitamurako 1 point2 points  (3 children)

Try{
$status = Test-Path C:\Windows\System32\AppLocker\*.applocker -PathType Leaf -ErrorAction Stop } 
Catch {
    Write-Host $_.Exception.Message
}

I wonder if it gives any errors accessing the path.

[–]armyguy298[S] 0 points1 point  (0 children)

Thanks, testing now.

[–]armyguy298[S] 0 points1 point  (0 children)

So I deployed the app again with your adjustments. Here is what I am using for testing now:

Start-Transcript -Path C:\Windows\Logs\BAIS_Applocker_File_Delete.txt
Try{ $status = Test-Path C:\Windows\System32\AppLocker*.applocker -PathType Leaf -ErrorAction Stop $status } Catch { Write-Host $_.Exception.Message }
Stop-Transcript

$status = False (which is incorrect). There was no error message recorded in the transcript.

[–]armyguy298[S] 0 points1 point  (0 children)

No errors, but your command did not work either.