Skip to content

Instantly share code, notes, and snippets.

@drmohundro
Last active December 25, 2018 06:47
Show Gist options
  • Save drmohundro/5a131d7ff6f291a33334 to your computer and use it in GitHub Desktop.
Save drmohundro/5a131d7ff6f291a33334 to your computer and use it in GitHub Desktop.
PowerShell functions to start/stop IIS Express in the specified directory as a background job
$jobName = 'IisExpressJob'
function Start-IisExpress($pathToSource) {
Start-Job -Name $jobName -Arg $pathToSource -ScriptBlock {
param ($pathToSource)
& 'C:\Program Files (x86)\IIS Express\iisexpress.exe' /port:1234 /path:$pathToSource
}
}
function Stop-IisExpress {
Stop-Job -Name $jobName
Remove-Job -Name $jobName
}
@mohankumarp
Copy link

Stop-IISExpress is not stopping website which is started by Start-IISExpress , Any clue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment