HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //var/opt/nydus/ops/customer_local_ops/operating_system/powershell/shutdown_ovh_vm.ps1
try {
    Set-ItemProperty -Path "REGISTRY::HKEY_USERS\.DEFAULT\Control Panel\Desktop" -Name "WaitToKillAppTimeout" -Value "20000" -Type String
    Set-ItemProperty -Path "REGISTRY::HKEY_USERS\.DEFAULT\Control Panel\Desktop" -Name "HungAppTimeout" -Value "20000" -Type String
    Set-ItemProperty -Path "REGISTRY::HKEY_USERS\.DEFAULT\Control Panel\Desktop" -Name "AutoEndTasks" -Value "1" -Type String
    Set-ItemProperty -Path "REGISTRY::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control" -Name "WaitToKillServiceTimeout" -Value "60000" -Type String
    Write-Host "Attempting graceful shutdown..."
    Stop-Computer -Force -Confirm:$false -ErrorAction Stop
}
catch {
    Write-Host "Graceful shutdown failed. Preparing for forced shutdown..."
    Add-Type -AssemblyName PresentationFramework
    [System.Windows.MessageBox]::Show("The system will shut down in 2 minutes. Please save your work..")
    Start-Sleep -Seconds 120
    Stop-Computer -Force
}