Powershell Script 2 Command (ps2cmd)

Converts a Powershell script to a single Powershell Command. Use this as a work-around to run a Powershell script (normally a .ps1 file) when Powershell scripts are blocked from running on the system.

Steps

  1. Enter the Powershell Script (collection of commands) into the field below.
  2. Click “Convert”
  3. Select “copy to clipboard” link
  4. Open a Powershell window then Paste the Powershell Command into the Powershell window.
Powershell Script
Powershell Command
powershell.exe -Command "
# Generated Fri, 19 Apr 2024 15:13:32 +0000
Write-Host `"Hello World`"
"