Scripts/SteamToggleUpdate/ToggleSkyrimUpdates.ps1

20 lines
654 B
PowerShell
Raw Normal View History

2023-10-26 11:03:09 -03:00
$appId = 489830
$networkLocation = "https://raw.githubusercontent.com/IsaacShoebottom/Scripts/master/SteamToggleUpdate/ToggleUpdates.ps1"
# Test if ToggleUpdates.ps1 exists and invoke it if it does
If (Test-Path -Path ".\ToggleUpdates.ps1" -PathType Leaf) {
.\ToggleUpdates.ps1 $appId
}
Else {
2023-10-26 11:15:34 -03:00
# construct temp path
$env:temp = [System.IO.Path]::GetTempPath()
$tempPath = $env:temp + "\ToggleUpdates.ps1"
2023-10-26 11:03:09 -03:00
# Download the network script
$wc = New-Object System.Net.WebClient
2023-10-26 11:15:34 -03:00
$wc.DownloadFile($networkLocation, $tempPath)
2023-10-26 11:03:09 -03:00
# Invoke the network script
2023-10-26 11:15:34 -03:00
&$tempPath $appId
2023-10-26 11:03:09 -03:00
# Delete the network script
2023-10-26 11:15:34 -03:00
Remove-Item -Path $tempPath
2023-10-26 11:03:09 -03:00
}