Skip to content

Commit

Permalink
release 1.03
Browse files Browse the repository at this point in the history
  • Loading branch information
blueclouds8666 committed Jan 26, 2024
1 parent c48b6fb commit 42b834f
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 26 deletions.
12 changes: 6 additions & 6 deletions linux/Documentation.htm
Original file line number Diff line number Diff line change
Expand Up @@ -381,32 +381,32 @@ <h2>4. Arguments:</h2>
<h2>5. Use examples:</h2>
<p>Download all files for the KB951376 update, as well as the details sheets:</p>
<dl>
<dd><b>MSUpdate-DL.ps1 KB951376 -details</b></dd>
<dd><b>MSUpdate-DL.ps1 KB951376 --details</b></dd>
</dl>

<p>Download the English version file for the KB951376 update, and log the process:</p>
<dl>
<dd><b>MSUpdate-DL.ps1 KB951376 -language="enu" -log</b></dd>
<dd><b>MSUpdate-DL.ps1 KB951376 --language="enu" --log</b></dd>
</dl>

<p>Download the KB951376 update, but only the files corresponding to Windows XP and Vista:</p>
<dl>
<dd><b>MSUpdate-DL.ps1 KB951376 -ntversion="51,60"</b></dd>
<dd><b>MSUpdate-DL.ps1 KB951376 --ntversion="51,60"</b></dd>
</dl>

<p>Batch download updates to an external drive with the details files:</p>
<dl>
<dd><b>MSUpdate-DL-Batch.ps1 -output="E:\backup\updates\" -details</b></dd>
<dd><b>MSUpdate-DL-Batch.ps1 --output="E:\backup\updates\" --details</b></dd>
</dl>

<p>Batch download updates only for the itanium versions of Windows Server 2003, 2008 and 2008 R2:</p>
<dl>
<dd><b>MSUpdate-DL-Batch.ps1 -architecture="itanium" -ntversion="52,60,61"</b></dd>
<dd><b>MSUpdate-DL-Batch.ps1 --architecture="itanium" --ntversion="52,60,61"</b></dd>
</dl>

<p>Batch download updates only those in English, German or French, only for Windows Vista x64, and log the process:</p>
<dl>
<dd><b>MSUpdate-DL-Batch.ps1 -language="enu,deu,fra" -ntversion="60" -architecture="64" -log</b></dd>
<dd><b>MSUpdate-DL-Batch.ps1 --language="enu,deu,fra" --ntversion="60" --architecture="64" --log</b></dd>
</dl>

<br>
Expand Down
4 changes: 2 additions & 2 deletions linux/MSUpdate-DL-Batch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Appname: Microsoft Update Downloader
Author: NEONFLOPPY
Website: http://neonfloppy.sytes.net
Version: Release 1.02 - Published: 14 May 2023
Version: Release 1.03 - Published: 26 Jan 2024
License: Unlicense (https://unlicense.org)
#>

Expand Down Expand Up @@ -38,7 +38,7 @@ function MSUpdate-DL-Batch
}
if ($parameter -eq "--version") {
Write-Host "Microsoft Update Downloader" -ForegroundColor Cyan -BackgroundColor Black
Write-Host "Release 1.02 - 14 May 2023" -ForegroundColor Magenta -BackgroundColor Black
Write-Host "Release 1.03 - 26 Jan 2024" -ForegroundColor Magenta -BackgroundColor Black
Write-Host "by NEONFLOPPY. http://neonfloppy.sytes.net`r`n" -ForegroundColor White
Write-Host "This project has been published under the Unlincense license. https://unlicense.org" -ForegroundColor White
Write-Host "This is free software: you are free to change and redistribute it`r`n" -ForegroundColor White
Expand Down
31 changes: 26 additions & 5 deletions linux/MSUpdate-DL.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Appname: Microsoft Update Downloader
Author: NEONFLOPPY
Website: http://neonfloppy.sytes.net
Version: Release 1.02 - Published: 14 May 2023
Version: Release 1.03 - Published: 26 Jan 2024
License: Unlicense (https://unlicense.org)
#>

Expand Down Expand Up @@ -154,8 +154,16 @@ function MSUpdate-DL
}

if ($parameter -match "--output=") {
$basedir = $parameter.substring(8)
$outdir = -join($basedir, $request, "/")
$basedir = $parameter.substring(9)

# check if the path ends with a slash
if ($string -match '/$') {
$outdir = -join($basedir, $request, "/")

# if it doesn't, we need to add one
} else {
$outdir = -join($basedir, "/", $request, "/")
}
}

if ($parameter -match "--log") {
Expand Down Expand Up @@ -197,7 +205,7 @@ function MSUpdate-DL
# show version information
if ($request -eq "--version") {
Write-Host "Microsoft Update Downloader" -ForegroundColor Cyan -BackgroundColor Black
Write-Host "Release 1.02 - 14 May 2023" -ForegroundColor Magenta -BackgroundColor Black
Write-Host "Release 1.03 - 26 Jan 2024" -ForegroundColor Magenta -BackgroundColor Black
Write-Host "by NEONFLOPPY. http://neonfloppy.sytes.net`r`n" -ForegroundColor White
Write-Host "This project has been published under the Unlincense license. https://unlicense.org" -ForegroundColor White
Write-Host "This is free software: you are free to change and redistribute it`r`n" -ForegroundColor White
Expand Down Expand Up @@ -231,7 +239,13 @@ function MSUpdate-DL

# get the html contents of the query, in order to check the actual textual response
$doc = $kbObj.ParsedHtml
$div = $doc.getElementById("ctl00_catalogBody_noResults")

# check if the html page includes kb update results
if ([regex]::matches($kbObj, "ctl00_catalogBody_noResults").count -ne 0) {
$div = $true
} else {
$div = $null
}

# check if the html contains an item not found message
if ($div -ne $null) {
Expand Down Expand Up @@ -571,5 +585,12 @@ function MSUpdate-DL
}
}
}

# if the output directory is empty, we get rid of it
if ((Get-ChildItem -Path $outdir).Count -eq 0) {
$msg = "[INFO] No update files found matching the specified filters"
Write-Host $msg -ForegroundColor Green -BackgroundColor Black
Remove-Item -Path $outdir
}
}
MSUpdate-DL
12 changes: 6 additions & 6 deletions windows/Documentation.htm
Original file line number Diff line number Diff line change
Expand Up @@ -381,32 +381,32 @@ <h2>4. Arguments:</h2>
<h2>5. Use examples:</h2>
<p>Download all files for the KB951376 update, as well as the details sheets:</p>
<dl>
<dd><b>MSUpdate-DL.ps1 KB951376 -details</b></dd>
<dd><b>MSUpdate-DL.ps1 KB951376 --details</b></dd>
</dl>

<p>Download the English version file for the KB951376 update, and log the process:</p>
<dl>
<dd><b>MSUpdate-DL.ps1 KB951376 -language="enu" -log</b></dd>
<dd><b>MSUpdate-DL.ps1 KB951376 --language="enu" --log</b></dd>
</dl>

<p>Download the KB951376 update, but only the files corresponding to Windows XP and Vista:</p>
<dl>
<dd><b>MSUpdate-DL.ps1 KB951376 -ntversion="51,60"</b></dd>
<dd><b>MSUpdate-DL.ps1 KB951376 --ntversion="51,60"</b></dd>
</dl>

<p>Batch download updates to an external drive with the details files:</p>
<dl>
<dd><b>MSUpdate-DL-Batch.ps1 -output="E:\backup\updates\" -details</b></dd>
<dd><b>MSUpdate-DL-Batch.ps1 --output="E:\backup\updates\" --details</b></dd>
</dl>

<p>Batch download updates only for the itanium versions of Windows Server 2003, 2008 and 2008 R2:</p>
<dl>
<dd><b>MSUpdate-DL-Batch.ps1 -architecture="itanium" -ntversion="52,60,61"</b></dd>
<dd><b>MSUpdate-DL-Batch.ps1 --architecture="itanium" --ntversion="52,60,61"</b></dd>
</dl>

<p>Batch download updates only those in English, German or French, only for Windows Vista x64, and log the process:</p>
<dl>
<dd><b>MSUpdate-DL-Batch.ps1 -language="enu,deu,fra" -ntversion="60" -architecture="64" -log</b></dd>
<dd><b>MSUpdate-DL-Batch.ps1 --language="enu,deu,fra" --ntversion="60" --architecture="64" --log</b></dd>
</dl>

<br>
Expand Down
4 changes: 2 additions & 2 deletions windows/MSUpdate-DL-Batch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Appname: Microsoft Update Downloader
Author: NEONFLOPPY
Website: http://neonfloppy.sytes.net
Version: Release 1.02 - Published: 14 May 2023
Version: Release 1.03 - Published: 26 Jan 2024
License: Unlicense (https://unlicense.org)
#>

Expand Down Expand Up @@ -38,7 +38,7 @@ function MSUpdate-DL-Batch
}
if ($parameter -eq "--version") {
Write-Host "Microsoft Update Downloader" -ForegroundColor Cyan -BackgroundColor Black
Write-Host "Release 1.02 - 14 May 2023" -ForegroundColor Magenta -BackgroundColor Black
Write-Host "Release 1.03 - 26 Jan 2024" -ForegroundColor Magenta -BackgroundColor Black
Write-Host "by NEONFLOPPY. http://neonfloppy.sytes.net`r`n" -ForegroundColor White
Write-Host "This project has been published under the Unlincense license. https://unlicense.org" -ForegroundColor White
Write-Host "This is free software: you are free to change and redistribute it`r`n" -ForegroundColor White
Expand Down
31 changes: 26 additions & 5 deletions windows/MSUpdate-DL.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Appname: Microsoft Update Downloader
Author: NEONFLOPPY
Website: http://neonfloppy.sytes.net
Version: Release 1.02 - Published: 14 May 2023
Version: Release 1.03 - Published: 26 Jan 2024
License: Unlicense (https://unlicense.org)
#>

Expand Down Expand Up @@ -154,8 +154,16 @@ function MSUpdate-DL
}

if ($parameter -match "--output=") {
$basedir = $parameter.substring(8)
$outdir = -join($basedir, $request, "\")
$basedir = $parameter.substring(9)

# check if the path ends with a slash
if ($string -match '\\$') {
$outdir = -join($basedir, $request, "\")

# if it doesn't, we need to add one
} else {
$outdir = -join($basedir, "\", $request, "\")
}
}

if ($parameter -match "--log") {
Expand Down Expand Up @@ -197,7 +205,7 @@ function MSUpdate-DL
# show version information
if ($request -eq "--version") {
Write-Host "Microsoft Update Downloader" -ForegroundColor Cyan -BackgroundColor Black
Write-Host "Release 1.02 - 14 May 2023" -ForegroundColor Magenta -BackgroundColor Black
Write-Host "Release 1.03 - 26 Jan 2024" -ForegroundColor Magenta -BackgroundColor Black
Write-Host "by NEONFLOPPY. http://neonfloppy.sytes.net`r`n" -ForegroundColor White
Write-Host "This project has been published under the Unlincense license. https://unlicense.org" -ForegroundColor White
Write-Host "This is free software: you are free to change and redistribute it`r`n" -ForegroundColor White
Expand Down Expand Up @@ -231,7 +239,13 @@ function MSUpdate-DL

# get the html contents of the query, in order to check the actual textual response
$doc = $kbObj.ParsedHtml
$div = $doc.getElementById("ctl00_catalogBody_noResults")

# check if the html page includes kb update results
if ([regex]::matches($kbObj, "ctl00_catalogBody_noResults").count -ne 0) {
$div = $true
} else {
$div = $null
}

# check if the html contains an item not found message
if ($div -ne $null) {
Expand Down Expand Up @@ -571,5 +585,12 @@ function MSUpdate-DL
}
}
}

# if the output directory is empty, we get rid of it
if ((Get-ChildItem -Path $outdir).Count -eq 0) {
$msg = "[INFO] No update files found matching the specified filters"
Write-Host $msg -ForegroundColor Green -BackgroundColor Black
Remove-Item -Path $outdir
}
}
MSUpdate-DL

0 comments on commit 42b834f

Please sign in to comment.