PowerShell Protect
Audit and block PowerShell scripts on Windows.
Last updated
Install-Module PowerShellProtect
Install-PowerShellProtect
$Condition = New-PSPCondition -Property "command" -contains -Value "webrequest"
$BlockAction = New-PSPAction -Block
$Rule = New-PSPRule -Name "Web Request" -Condition $Condition -Action $BlockAction
$Configuration = New-PSPConfiguration -Rule $Rule -Action $BlockAction
Set-PSPConfiguration -Configuration $Configuration -FileSystemTest-PSPConfiguration -ConfigurationPath ".\config.xml" -ScriptBlock { Invoke-WebRequest }