Update Script.ps1

master
Chris Nutter 2023-09-04 09:33:37 -07:00
parent f45797f667
commit 160a7390fb
1 changed files with 13 additions and 0 deletions

View File

@ -29,3 +29,16 @@ powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
# Set display to turn black after 2 hours # Set display to turn black after 2 hours
powercfg -change -monitor-timeout-ac 120 powercfg -change -monitor-timeout-ac 120
$url = 'https://plexamp.plex.tv/plexamp.plex.tv/desktop/'
$latestVersion = Invoke-WebRequest -Uri $url | Select-String -Pattern 'Plexamp Setup [0-9\.]+\.exe' |
ForEach-Object {
$_.Matches.Value.Split(' ')[-1].Trim('.exe')
} | Sort-Object -Descending | Select-Object -First 1
$downloadUrl = $url + "Plexamp%20Setup%20$latestVersion.exe"
$outputPath = "$env:USERPROFILE\Downloads\PlexampSetup.exe"
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputPath
Start-Process -FilePath $outputPath -Wait