Generalize steam toggle more

This commit is contained in:
Isaac Shoebottom 2023-10-26 10:59:35 -03:00
parent 276291efce
commit f4079b0ef1
2 changed files with 29 additions and 9 deletions

View File

@ -0,0 +1,16 @@
$appId = 1091500
$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 {
# Download the network script
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($networkLocation, ".\ToggleUpdates.ps1")
# Invoke the network script
.\ToggleUpdates.ps1 $appId
# Delete the network script
Remove-Item -Path ".\ToggleUpdates.ps1"
}

View File

@ -45,8 +45,9 @@ function parseVDFforPath([int]$appId) {
} }
} }
} }
$Manifest = parseVDFforPath(1091500)
# function that changes the read only attribute of the manifest file
function toggleUpdate($Manifest) {
# Get the read only attribute # Get the read only attribute
$ReadOnly = (Get-Item $Manifest).IsReadOnly $ReadOnly = (Get-Item $Manifest).IsReadOnly
@ -58,3 +59,6 @@ Write-Host "Manifest file's read only attribute is now $((Get-Item $Manifest).Is
# Pause the script to see the output # Pause the script to see the output
Read-Host -Prompt "Press Enter to exit" Read-Host -Prompt "Press Enter to exit"
}
toggleUpdate(parseVDFforPath($args[0]))