Skip to content

poweroff

Halts the computer (needs admin rights)

#Requires -Version 5.1

#Requires -RunAsAdministrator

try {
	if ($IsLinux) {
		sudo shutdown
	} else {
		Stop-Computer
	}
	exit 0
} catch {
throw
}

This script has no configurable parameters.

An interactive directory of PowerShell scripts.