PowerShell Protect
Examples integrating with PowerShell Protect.
Display Log Messages in PowerShell Universal
PowerShell Protect Configuration
$Condition = New-PSPCondition -Property "script" -Contains -Value "\\corp\human-resources"
$Block = New-PSPAction -Http -Address "http://localhost:8080/protect" -Format "{computerName},{userName}" -Name 'Universal'
$Rule = New-PSPRule -Action $Block -Condition $Condition -Name "HR Share"
$Config = New-PSPConfiguration -Rule $Rule -Action $Block -License "<License></License>"
Set-PSPConfiguration -Configuration $Config -FileSystemPowerShell Universal Configuration
Start-PSUServer -Port 8080 -Configuration {
New-PSUEndpoint -Url "/protect" -Method POST -Endpoint {
$Data = "$Env:Temp\data.csv"
if (-not (Test-Path $Data))
{
"computer,user" | Out-File $Data
}
$Body | Out-File $Data
}​
New-PSUDashboard -Name "Protect" -Content {
New-UDDashboard -Title 'Protect' -Content {
$Data = Import-Csv -Path "$Env:Temp\data.csv"
New-UDTable -Data $Data
}
}
}Last updated
Was this helpful?
