Last active
March 24, 2022 10:21
-
-
Save joshjavier/e10750c7b066457d33837feeb7de3481 to your computer and use it in GitHub Desktop.
PowerShell script for setting up Parsec Portable on Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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