pull/232/head
KnifMelti 2022-11-06 06:37:34 +01:00
parent 7039fa97a2
commit bcb274b178
2 changed files with 5 additions and 5 deletions

View File

@ -89,9 +89,9 @@ Use White List instead of Black List. This setting will not create the "excluded
Get Black/White List from Path (URL/UNC/Local) (download/copy to Winget-AutoUpdate installation location if external list is newer). Get Black/White List from Path (URL/UNC/Local) (download/copy to Winget-AutoUpdate installation location if external list is newer).
**-ModsPath** **-ModsPath**
Get Mods from Path (URL/UNC/Local) (download/copy to `mods` in Winget-AutoUpdate installation location if external mods is newer). Get Mods from Path (URL/UNC/Local) (download/copy to `mods` in Winget-AutoUpdate installation location if external mods are newer).
For URL: This requires a site directory with `Options +Indexes` in `.htaccess` and no index page overriding the listing of files. For URL: This requires a site directory with `Options +Indexes` in `.htaccess` and no index page overriding the listing of files.
Or an index page with href listings of all the Mods to be downloaded: Or an index page with href listing of all the Mods to be downloaded:
``` ```
<ul> <ul>
<li><a href="Adobe.Acrobat.Reader.32-bit-install.ps1"> Adobe.Acrobat.Reader.32-bit-install.ps1</a></li> <li><a href="Adobe.Acrobat.Reader.32-bit-install.ps1"> Adobe.Acrobat.Reader.32-bit-install.ps1</a></li>

View File

@ -15,7 +15,7 @@ function Test-ModsPath ($ModsPath, $WingetUpdatePath) {
# enable TLS 1.2 and TLS 1.1 protocols # enable TLS 1.2 and TLS 1.1 protocols
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12, [Net.SecurityProtocolType]::Tls11 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12, [Net.SecurityProtocolType]::Tls11
#Get Index of $ExternalMods (or index page with href listings of all the Mods) #Get Index of $ExternalMods (or index page with href listing of all the Mods)
try { try {
$WebResponse = Invoke-WebRequest -Uri $ExternalMods $WebResponse = Invoke-WebRequest -Uri $ExternalMods
} }
@ -25,7 +25,7 @@ function Test-ModsPath ($ModsPath, $WingetUpdatePath) {
# Collect the external list of href links # Collect the external list of href links
$ModLinks = $WebResponse.Links | Select-Object -ExpandProperty href $ModLinks = $WebResponse.Links | Select-Object -ExpandProperty href
#Delete Local Mods that doesn't exist Externally #Delete Local Mods that don't exist Externally
foreach ($Mod in $InternalModsNames) { foreach ($Mod in $InternalModsNames) {
If ($Mod -notin $ModLinks) { If ($Mod -notin $ModLinks) {
Remove-Item $LocalMods\$Mod -Force -ErrorAction SilentlyContinue | Out-Null Remove-Item $LocalMods\$Mod -Force -ErrorAction SilentlyContinue | Out-Null
@ -68,7 +68,7 @@ function Test-ModsPath ($ModsPath, $WingetUpdatePath) {
if (Test-Path -Path $ExternalMods"\*.ps1") { if (Test-Path -Path $ExternalMods"\*.ps1") {
#Get File Names Externally #Get File Names Externally
$ExternalModsNames = Get-ChildItem -Path $ExternalMods -Name -Recurse -Include *.ps1 $ExternalModsNames = Get-ChildItem -Path $ExternalMods -Name -Recurse -Include *.ps1
#Delete Local Mods that doesn't exist Externally #Delete Local Mods that don't exist Externally
foreach ($Mod in $InternalModsNames){ foreach ($Mod in $InternalModsNames){
If($Mod -notin $ExternalModsNames ){ If($Mod -notin $ExternalModsNames ){
Remove-Item $LocalMods\$Mod -Force -ErrorAction SilentlyContinue | Out-Null Remove-Item $LocalMods\$Mod -Force -ErrorAction SilentlyContinue | Out-Null