Skip to content

Instantly share code, notes, and snippets.

@dkendrick
Created November 4, 2014 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkendrick/3f2d018ccf9d5a515222 to your computer and use it in GitHub Desktop.
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.
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