PowerShell Pro Tools
Ironman SoftwareGitHub
  • About
  • System Requirements
  • PowerShell Tools Documentation
    • Visual Studio
      • Analysis
      • Debugging
        • Local Debugging
        • Remote Debugging
      • Format Document
      • Go to Definition
      • Packaging in Visual Studio
      • PowerShell 7 Support
      • PowerShell Interactive Window
      • Project System
        • Advanced
        • Debug
        • Build Events
      • Settings
        • General
        • .editorconfig
        • Analysis
        • Diagnostics
      • Tool Windows
      • Refactoring
      • Unit Test Adapter
      • User Interface Design
        • Windows Forms
  • PowerShell Pro Tools Documentation
    • Visual Studio Code
      • Automating Visual Studio Code
      • Code Conversion
      • Debugging
        • Run in New Terminal
        • One-Click Attach
      • Decompiler
      • Diagnostics
      • Enhanced Hover
      • Generating a UI from a function
      • Generate a Tool from a Function
      • Packaging in Visual Studio Code
      • Pin Session
      • PowerShell Explorer
      • Profiler
      • Sign On Save
      • RapidSense
      • Refactoring
      • Rename Symbols
      • Quick Scripts
      • Windows Forms Designer
    • Installers
    • Packaging
      • Package.psd1
      • PowerShell Packager
      • Package Hosts
      • Package as Service
      • Packaging on Linux
      • Packaging on Mac OS X
      • Continuous Integration
      • Anti-Virus
    • PowerShell Module
      • Global Hotkeys
      • Show-PSEditor
      • Show-PSScriptPad
      • Show-TUIDesigner
      • ConvertTo-CSharp
      • ConvertTo-PowerShell
      • Merge-Script
      • Install-PoshProToolsLicense
      • about_MergeScriptConfig
      • Show-WinFormDesigner
    • PowerShell Protect
      • Getting Started
      • Installation
      • Actions
      • Rules
      • Configuration
    • PSCommander
    • PSScriptPad
    • Installation and Licensing
      • Visual Studio Offline Installation
  • Changelog
    • PowerShell Tools for Visual Studio
    • PowerShell Pro Tools for Visual Studio Code
    • PowerShell Packager
    • PSScriptPad
    • PowerShell Pro Tools Module
Powered by GitBook
On this page
  1. PowerShell Pro Tools Documentation
  2. PowerShell Protect

Getting Started

Getting started with PowerShell Protect.

PreviousPowerShell ProtectNextInstallation

Last updated 3 years ago

PowerShell Protect can be installed from the PowerShell Gallery.

Install-Module PowerShellProtect

To install the AMSI provider that is used to audit and block scripts, you will need to run the following command.

This command needs to be run as administrator.

Install-PowerShellProtect
$Configuration = New-PSPConfiguration 
Set-PSPConfiguration -Configuration $Configuration -FileSystem -License '<myLicense>'

A license is required to configure your own rules. The built-in rules can be used for free without a license.

For example, this configuration will block and audit any script that contains a command with webrequest in the name.

$Condition = New-PSPCondition -Property "command" -contains -Value "webrequest"
$BlockAction = New-PSPAction -Block
$FileAction = New-PSPAction -File -Format "{applicationName},{rule}" -Path "%temp%\audit.csv" -Name 'File'
$Rule = New-PSPRule -Name "Web Request" -Condition $Condition -Action @($BlockAction, $FileAction)

$Configuration = New-PSPConfiguration -Rule $Rule -Action @($BlockAction, $FileAction)
Set-PSPConfiguration -Configuration $Configuration -FileSystem -License '<myLicense>'

Once installed, the will be enabled. You can also enable additional rules using the PowerShell Protect configuration cmdlets.

Default Rules