Created
November 4, 2014 03:25
-
-
Save dkendrick/3f2d018ccf9d5a515222 to your computer and use it in GitHub Desktop.
Run tasks in the background with powershell. This was inspired by the "&" functionality of bash.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bg() | |
{ | |
if ($args.length -lt 0) | |
{ | |
Write-Output "No parameters specified"; | |
return; | |
} | |
if ($args.length -gt 1) | |
{ | |
$arguments = $args | select -skip 1; | |
Start-Process -NoNewWindow $args[0] -ArgumentList $arguments; | |
return; | |
} | |
Start-Process -NoNewWindow $args[0]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment