Created
March 7, 2014 12:43
-
-
Save JonCanning/9410811 to your computer and use it in GitHub Desktop.
This file contains 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
module IISExpress | |
open System.Diagnostics | |
open System | |
open System.IO | |
let killProcess processName = | |
let processStartInfo = ProcessStartInfo(FileName = "taskkill", | |
Arguments = "/F /IM " + processName, | |
UseShellExecute = false, | |
CreateNoWindow = true) | |
Process.Start(processStartInfo).WaitForExit() | |
let startIIS path port = | |
let arguments = String.Format("/path:{0} /port:{1}", path, port ) | |
let processStartInfo = ProcessStartInfo(FileName = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "\\IIS Express\\iisexpress.exe", | |
Arguments = arguments.ToString(), | |
UseShellExecute = false, | |
CreateNoWindow = true) | |
Process.Start processStartInfo |> ignore | |
let stopIIS() = | |
killProcess "iisexpress.exe" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment