Skip to content

Instantly share code, notes, and snippets.

@emtee40
Forked from ferventcoder/PowerShellCommand.ps1
Created September 13, 2018 13:49
Show Gist options
  • Select an option

  • Save emtee40/54c53acc1b47fa11f609f59853e5250e to your computer and use it in GitHub Desktop.

Select an option

Save emtee40/54c53acc1b47fa11f609f59853e5250e to your computer and use it in GitHub Desktop.
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$psFileFullPath = Join-Path $toolsDir "ps1crash.ps1"
Install-BinFile `
-Name ps1crash `
-Path "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" `
-Command "-NoProfile -ExecutionPolicy unrestricted -Command `"&'$psFileFullPath' %*`""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment