mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-23 05:01:37 +01:00
Update reboot.ps1
This commit is contained in:
parent
0cdf5ec9a1
commit
fe3cd68194
@ -1,20 +1,24 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Reboots the local computer (needs admin rights)
|
||||
Reboots the computer (needs admin rights)
|
||||
.DESCRIPTION
|
||||
This PowerShell script reboots the local computer (needs admin rights).
|
||||
This PowerShell script reboots the local computer immediately (needs admin rights).
|
||||
.EXAMPLE
|
||||
PS> ./reboot
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz / License: CC0
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
#Requires -RunAsAdministrator
|
||||
|
||||
try {
|
||||
Restart-Computer
|
||||
if ($IsLinux) {
|
||||
sudo reboot
|
||||
} else {
|
||||
Restart-Computer
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user