Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for reboot.ps

(view source code of reboot.ps as plain text)

  1. if ( $HOME[0] -eq "/" ) {
  2. 	# Linux
  3. 	shutdown -r
  4. } else {
  5. 	# Windows
  6. 	( Get-WMIObject -Query "Select * From Win32_OperatingSystem Where Primary=True" ).Reboot( )
  7. }
  8.  

page last uploaded: 2017-04-06, 13:33