pull/232/head
KnifMelti 2022-11-04 22:40:03 +01:00
parent 3262d11099
commit 04dd756217
1 changed files with 9 additions and 11 deletions

View File

@ -23,20 +23,18 @@ function Test-ModsPath ($ModsPath, $WingetUpdatePath) {
return $False
}
# Get the list of links, skip the first one ("../") if listing is allowed
$ModLinks = $WebResponse.Links | Select-Object -ExpandProperty href -Skip 1
#Delete Local Mods that doesn't exist Externally
if ($WebResponse) {
# Get the list of links, skip the first one ("../") if listing is allowed
$ModLinks = $WebResponse.Links | Select-Object -ExpandProperty href -Skip 1
foreach ($Mod in $InternalModsNames) {
try {
If ($Mod -notin $ModLinks) {
Remove-Item $LocalMods\$Mod -Force | Out-Null
}
}
catch {
#Do nothing
foreach ($Mod in $InternalModsNames) {
try {
If ($Mod -notin $ModLinks) {
Remove-Item $LocalMods\$Mod -Force | Out-Null
}
}
catch {
#Do nothing
}
}
#Loop through all links