Guest User

Untitled

a guest
Oct 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. param(
  2. [string] $Path = $(throw "Path is required."),
  3. [string] $Port = $(throw "Port is required.")
  4. )
  5. Get-Process | where { $_.ProcessName -like "IISExpress" } | Stop-Process
  6. $IISExpressExe = '"c:\Program Files (x86)\IIS Express\iisexpress.exe"'
  7. $Path = Resolve-Path $Path
  8. $Params = "/path:$Path /port:$Port"
  9. $Command = "$IISExpressExe $Params"
  10. Start-Process "$IISExpressExe" -ArgumentList "$Params"
  11. Start-Sleep -m 1000
  12. Write-Host "Site started"
Add Comment
Please, Sign In to add comment