Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for shutdown.ps

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

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

page last uploaded: 2017-07-06, 12:37