param(
$team_id,
$key
)
while(!(Test-NetConnection Google.com).PingSucceeded){
Start-Sleep -Seconds 1
}
Get-ChildItem -Path C:\ProgramData\Easy-GPU-P -Recurse | Unblock-File
if (Test-Path HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Parsec)
{}
else {
(New-Object System.Net.WebClient).DownloadFile("https://builds.parsecgaming.com/package/parsec-windows.exe", "C:\Users\$env:USERNAME\Downloads\parsec-windows.exe")
Start-Process "C:\Users\$env:USERNAME\Downloads\parsec-windows.exe" -ArgumentList "/silent", "/shared","/team_id=$team_id","/team_computer_key=$key" -wait
$configfile = Get-Content C:\ProgramData\Parsec\config.txt
$configfile += "host_virtual_monitors = 1"
$configfile += "host_privacy_mode = 1"
$configfile | Out-File C:\ProgramData\Parsec\config.txt -Encoding ascii
Copy-Item -Path "C:\ProgramData\Easy-GPU-P\Parsec.lnk" -Destination "C:\Users\Public\Desktop"
}
Function ParsecVDDMonitorSetupScheduledTask {
$XML = @"
Monitors the state of Parsec Virtual Display and repairs if broken
\Monitor Parsec VDD State
true
$(([System.Security.Principal.WindowsIdentity]::GetCurrent()).Name)
PT2M
$(([System.Security.Principal.WindowsIdentity]::GetCurrent()).User.Value)
S4U
HighestAvailable
IgnoreNew
true
true
true
false
false
true
false
true
true
false
false
false
PT72H
7
C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe
-file %programdata%\Easy-GPU-P\VDDMonitor.ps1
"@
try {
Get-ScheduledTask -TaskName "Monitor Parsec VDD State" -ErrorAction Stop | Out-Null
Unregister-ScheduledTask -TaskName "Monitor Parsec VDD State" -Confirm:$false
}
catch {}
$action = New-ScheduledTaskAction -Execute 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe' -Argument '-file %programdata%\Easy-GPU-P\VDDMonitor.ps1'
$trigger = New-ScheduledTaskTrigger -AtStartup
Register-ScheduledTask -XML $XML -TaskName "Monitor Parsec VDD State" | Out-Null
}
Function VBCableInstallSetupScheduledTask {
$XML = @"
Install VB Cable
\Install VB Cable
true
$(([System.Security.Principal.WindowsIdentity]::GetCurrent()).Name)
PT2M
$(([System.Security.Principal.WindowsIdentity]::GetCurrent()).User.Value)
S4U
HighestAvailable
IgnoreNew
true
true
true
false
false
true
false
true
true
false
false
false
PT72H
7
C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe
-file %programdata%\Easy-GPU-P\VBCableInstall.ps1
"@
try {
Get-ScheduledTask -TaskName "Install VB Cable" -ErrorAction Stop | Out-Null
Unregister-ScheduledTask -TaskName "Install VB Cable" -Confirm:$false
}
catch {}
$action = New-ScheduledTaskAction -Execute 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe' -Argument '-file %programdata%\Easy-GPU-P\VBCableInstall.ps1'
$trigger = New-ScheduledTaskTrigger -AtStartup
Register-ScheduledTask -XML $XML -TaskName "Install VB Cable" | Out-Null
}
Function ParsecVDDInstallSetupScheduledTask {
$XML = @"
Install Parsec Virtual Display Driver
\Install Parsec Virtual Display Driver
true
$(([System.Security.Principal.WindowsIdentity]::GetCurrent()).Name)
PT2M
$(([System.Security.Principal.WindowsIdentity]::GetCurrent()).User.Value)
S4U
HighestAvailable
IgnoreNew
true
true
true
false
false
true
false
true
true
false
false
false
PT72H
7
C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe
-file %programdata%\Easy-GPU-P\ParsecVDDInstall.ps1
"@
try {
Get-ScheduledTask -TaskName "Install Parsec Virtual Display Driver" -ErrorAction Stop | Out-Null
Unregister-ScheduledTask -TaskName "Install Parsec Virtual Display Driver" -Confirm:$false
}
catch {}
$action = New-ScheduledTaskAction -Execute 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe' -Argument '-file %programdata%\Easy-GPU-P\ParsecVDDInstall.ps1'
$trigger = New-ScheduledTaskTrigger -AtStartup
Register-ScheduledTask -XML $XML -TaskName "Install Parsec Virtual Display Driver" | Out-Null
}
ParsecVDDMonitorSetupScheduledTask
VBCableInstallSetupScheduledTask
ParsecVDDInstallSetupScheduledTask
Start-ScheduledTask -TaskName "Install VB Cable"
Start-ScheduledTask -TaskName "Install Parsec Virtual Display Driver"
Start-ScheduledTask -TaskName "Monitor Parsec VDD State"