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