Upload files to "/"
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# RestartComputer.ps1
|
||||
# Wymaga uruchomienia z uprawnieniami Administratora
|
||||
#Requires -RunAsAdministrator
|
||||
|
||||
param (
|
||||
[Parameter(Position=0, HelpMessage="Czas do restartu w sekundach (domyślnie 5)")]
|
||||
[int]$Delay = 5
|
||||
)
|
||||
|
||||
if ($Delay -gt 0) {
|
||||
Write-Host "[INFO] Zlecono restart za $Delay sekund..." -ForegroundColor Yellow
|
||||
# Używamy systemowego shutdown.exe, ponieważ automatycznie wyświetla on
|
||||
# na środku ekranu ucznia duży, niebieski komunikat o nadchodzącym restarcie
|
||||
shutdown.exe /r /t $Delay /c "Komputer zostanie zrestartowany przez instruktora." /f
|
||||
} else {
|
||||
Write-Host "[INFO] Wymuszam natychmiastowy restart komputera (bez ostrzeżenia)..." -ForegroundColor Red
|
||||
Restart-Computer -Force
|
||||
}
|
||||
Reference in New Issue
Block a user