Skip to content

Instantly share code, notes, and snippets.

@davidalpert
Created April 28, 2011 03:31
Show Gist options
  • Save davidalpert/945744 to your computer and use it in GitHub Desktop.
Save davidalpert/945744 to your computer and use it in GitHub Desktop.
use rake to kickstart IIS Express
task :kickstart_iisexpress do
# this task is a workaround for the following issue: http://stackoverflow.com/questions/4605750/iis-express-from-command-line
path_to_iisExpress = File.join(tools_path, 'IIS Express', 'iisexpress.exe')
output = IO.popen(path_to_iisExpress) do |pipe|
sleep 3 #seconds
Process.kill("KILL", pipe.pid)
pipe.close
end
puts 'IIS Express successfully kickstarted.'
end
task :kickstart_iisexpress do
# this task is a workaround for the following issue: http://stackoverflow.com/questions/4605750/iis-express-from-command-line
puts 'starting IIS Express w/ no arguments to make sure it runs...'
path_to_iisExpress = File.join(tools_path, 'IIS Express', 'iisexpress.exe')
output = IO.popen(path_to_iisExpress) do |pipe|
'IIS Express started'.split(//).each do |c|
putc c
end
(1..5).each do
sleep 1 #seconds
putc '.'
end
Process.kill("KILL", pipe.pid)
out = pipe.read
pipe.close
puts 'IIS Express stopped; output was:'
puts
out
end
puts output
puts
puts 'IIS Express successfully kickstarted.'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment