functions/Schedule-Reboot.ps1
function Schedule-Reboot { [CmdletBinding()] param( [Parameter(mandatory=$true)] [decimal]$Hours, [switch]$Shutdown ) if ($Hours -eq $null){ [decimal]$Hours = Read-Host "Perferm action in how many hours?" } [int]$seconds = $hours * 3600 if ($Shutdown) { shutdown.exe /s /f /t $seconds } else { shutdown.exe /r /f /t $seconds } } |