diff --git a/SteamToggleUpdate/ToggleCyberpunkUpdates.ps1 b/SteamToggleUpdate/ToggleCyberpunkUpdates.ps1 index 3d3e10a..5aff926 100644 --- a/SteamToggleUpdate/ToggleCyberpunkUpdates.ps1 +++ b/SteamToggleUpdate/ToggleCyberpunkUpdates.ps1 @@ -6,11 +6,15 @@ If (Test-Path -Path ".\ToggleUpdates.ps1" -PathType Leaf) { .\ToggleUpdates.ps1 $appId } Else { + # construct temp path + $env:temp = [System.IO.Path]::GetTempPath() + $tempPath = $env:temp + "\ToggleUpdates.ps1" + # Download the network script $wc = New-Object System.Net.WebClient - $wc.DownloadFile($networkLocation, ".\ToggleUpdates.ps1") + $wc.DownloadFile($networkLocation, $tempPath) # Invoke the network script - .\ToggleUpdates.ps1 $appId + &$tempPath $appId # Delete the network script - Remove-Item -Path ".\ToggleUpdates.ps1" + Remove-Item -Path $tempPath } \ No newline at end of file diff --git a/SteamToggleUpdate/ToggleSkyrimUpdates.ps1 b/SteamToggleUpdate/ToggleSkyrimUpdates.ps1 index 0c2980c..4f70c38 100644 --- a/SteamToggleUpdate/ToggleSkyrimUpdates.ps1 +++ b/SteamToggleUpdate/ToggleSkyrimUpdates.ps1 @@ -6,11 +6,15 @@ If (Test-Path -Path ".\ToggleUpdates.ps1" -PathType Leaf) { .\ToggleUpdates.ps1 $appId } Else { + # construct temp path + $env:temp = [System.IO.Path]::GetTempPath() + $tempPath = $env:temp + "\ToggleUpdates.ps1" + # Download the network script $wc = New-Object System.Net.WebClient - $wc.DownloadFile($networkLocation, ".\ToggleUpdates.ps1") + $wc.DownloadFile($networkLocation, $tempPath) # Invoke the network script - .\ToggleUpdates.ps1 $appId + &$tempPath $appId # Delete the network script - Remove-Item -Path ".\ToggleUpdates.ps1" + Remove-Item -Path $tempPath } \ No newline at end of file