From fe3cd6819428a5551c2b7f21043e60f24ac8dede Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Sat, 20 Aug 2022 12:40:31 +0200 Subject: [PATCH] Update reboot.ps1 --- Scripts/reboot.ps1 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Scripts/reboot.ps1 b/Scripts/reboot.ps1 index d9032ade..e837cc0c 100755 --- a/Scripts/reboot.ps1 +++ b/Scripts/reboot.ps1 @@ -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])"