Palworld – Server Powershell Automation for Nightly Reboots

Server Powershell Automation

Use as a logon script with your palworld server. (Works best if you use a dedicated server/vm/pc for this with only palworld server installed via steam.) update your paths.

Theres not a api or command from steam to wait for updates so I gave it a window of 10 minutes to update the palworld server client (Feel free to adjust) and then it launches the server with command arguments for multithreading.

I reboot my server nightly at 5am since thats like the dead zone where no one is playing. And this just kicks off at bootup.

In the future i might find a way of implementing steamCMD to fetch the update but for now this is what i have.

Happy automation!

# Path to Steam executable (replace with the actual path)
$steamPath = 'C:\Program Files (x86)\Steam\Steam.exe'

# Path to Palworld server executable (replace with the actual path)
$palworldServerPath = 'C:\Program Files (x86)\Steam\steamapps\common\PalServer\PalServer.exe'

# Launch options for Palworld
$palworldLaunchOptions = "-useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS"

# Start Steam
    Start-Process -FilePath $steamPath 
    Echo "Launching Steam..."
    
# Wait for Steam to initialize (adjust the sleep duration as needed)
    Start-Sleep -Seconds 25
   
# Update all games in the library
    Start-Process -FilePath "$steamPath" -ArgumentList "-validate" -Wait
    Echo "Updating Libary..."

# Wait for 10 minutes for updating (adjust the sleep duration as needed)
    Start-Sleep -Seconds 600
    
# Start Palworld server with launch options
    Start-Process -FilePath $palworldServerPath -ArgumentList $palworldLaunchOptions 
    Echo "Launching Palworld..."
    
# Close Steam
    Stop-Process -Name Steam -Force -ErrorAction SilentlyContinue
    
    Exit
Volodymyr Azimoff
About Volodymyr Azimoff 13812 Articles
I love games and I live games. Video games are my passion, my hobby and my job. My experience with games started back in 1994 with the Metal Mutant game on ZX Spectrum computer. And since then, I’ve been playing on anything from consoles, to mobile devices. My first official job in the game industry started back in 2005, and I'm still doing what I love to do.

Be the first to comment

Leave a Reply

Your email address will not be published.


*