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/control_panel/powershell/plesk_server_prep.ps1
#Check to see if plesk install currently running
$process = Get-WmiObject -query  "select * from win32_process where " + `
"name like 'plesk-installer%' or name like 'parallels_installer_Microsoft_%'"
if($process){
    $process | %{$_.Terminate()}
}
#Remove any old installs
Get-WmiObject -query "select * from win32_product where name like '%Plesk%'" | %{$_.uninstall()}
#Download Installer
powershell.exe Invoke-WebRequest https://hfs-public.secureserver.net/-/Windows/plesk-installer.exe `
 -UseBasicParsing -OutFile C:\Windows\Temp\plesk-installer.exe
#Attempt clean install.
try{
    C:\Windows\Temp\plesk-installer.exe --select-product-id=panel --select-release-latest `
     --skip-components-check --ignore-key-errors --no-space-check --installation-type=typical
}catch{
    #Verify Mysql startup
    Get-Service | ?{$_.name -eq 'Mysql56' -and $_.Status -ne 'Running'} | Start-Service
    "Mysql56" | %{
        $service=gwmi win32_service -filter "name='$_' and not State='Running'"
        if($service){
            $service.ChangeStartMode("Automatic")
            $service.startservice()
        }
    }
    #Attempt to fix install
    C:\Windows\Temp\plesk-installer.exe --select-product-id=panel --select-release-latest `
     --skip-components-check --ignore-key-errors --no-space-check --upgrade-installed-components
}
Start-sleep -seconds 60
$verifyInstallLog = select-string -path C:\ParallelsInstaller\autoinstaller3.log -Pattern "The changes were applied successfully." -CaseSensitive
if((test-path C:\ParallelsInstaller\ai_action_time.xml) -and $verifyInstallLog){
    "Plesk Successfully Installed"
    exit 0
}
"ERROR - Plesk DID NOT INSTALL PROPERLY"
exit 1