Skip to content

Instantly share code, notes, and snippets.

@joshjavier
Last active March 24, 2022 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshjavier/e10750c7b066457d33837feeb7de3481 to your computer and use it in GitHub Desktop.
Save joshjavier/e10750c7b066457d33837feeb7de3481 to your computer and use it in GitHub Desktop.
PowerShell script for setting up Parsec Portable on Windows
# Download Parsec portable app
$client = New-Object System.Net.WebClient
$client.DownloadFile("https://builds.parsecgaming.com/package/parsec-flat-windows32.zip", "$HOME\Downloads\parsec-flat-windows32.zip")
# Extract the zip file
$ParsecDir = "$HOME\Downloads\parsec-portable"
Expand-Archive "$HOME\Downloads\parsec-flat-windows32.zip" -DestinationPath $ParsecDir
# Clean up
Remove-Item "$HOME\Downloads\parsec-flat-windows32.zip"
# Create a desktop shortcut
$SourceFilePath = "$ParsecDir\parsecd.exe"
$ShortcutPath = "$HOME\Desktop\Parsec.lnk"
$WScriptObj = New-Object -ComObject ("WScript.Shell")
$shortcut = $WscriptObj.CreateShortcut($ShortcutPath)
$shortcut.TargetPath = $SourceFilePath
$shortcut.WorkingDirectory = $ParsecDir
$shortcut.Save()
# Run Parsec
Invoke-Item "$HOME\Desktop\Parsec.lnk"
# Close PowerShell
Stop-Process -Id $PID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment