Updates (offline) durchführen
Modul OSDSUS und OSDUpdate in PowerShell integrieren um aktuellste Updates Windows 10 zu integrieren.
Installation beider Module OSDSUS und OSDUpdate mithilfe des PackageProviders und der verfügbaren PowerShell-Cmdlets.
Set-ExecutionPolicy Bypass -Scope Process -Force
Install-PackageProvider -Name NuGet -Force -Scope AllUsers -ForceBootstrap
Install-Module OSDSUS -Scope AllUsers -Force -AllowClobber -SkipPublisherCheck -Confirm:$false
Update-OSDSUS
Import-Module OSDSUS -Force
Install-Module OSDUpdate -Scope AllUsers -Force -AllowClobber -SkipPublisherCheck -Confirm:$false
Import-Module OSDUpdate -Force
Set-StrictMode -Version Latest
function fGetUpdates {
[CmdletBinding()]
Param(
[parameter(Position=0,Mandatory=$true)]
[String]$arch = "x64",
[parameter(Position=1,Mandatory=$true)]
[ValidateSet("SSU","LCU")]
[String]$SLCU,
[parameter(Position=2,Mandatory=$true)]
[ValidateSet("1909","1903","1809","1803")]
[String]$BuildNummer
)
# Check existence of OSDSUS-Module
if (!(Get-Module "OSDSUS")) {
Write-Host "OSDSUS-Module wird installiert ..."
Install-Module -Name OSDSUS -Scope AllUsers -Force -Verbose
Update-OSDSUS -Verbose
}
# Compare
if (((Get-InstalledModule -name OSDSUS).version).tostring() -ne (Find-Package -name osdsus -ProviderName "PowerShellGet").Version) {
Write-Host "Update necessary"
Update-OSDSUS -Verbose
}
# Get Update-Information
$updateInfo = Get-OSDUpdate | ? {$_.UpdateOS -eq 'Windows 10' -and $_.UpdateBuild -eq $BuildNummer -and $_.UpdateGroup -eq $SLCU -and $_.UpdateArch -eq $arch -and $_.IsLatestRevision -eq 'True'}
# Combine Path-Structure
$path = [IO.Path]::Combine("$env:SystemDrive\SetupDeployment\Updates", $updateInfo."UpdateOS", $updateInfo."UpdateBuild", $updateInfo."Updategroup")
# Create Folder-Structure for Updates
New-Item $path -ItemType Directory -Force -Verbose
# Download or match Updates
$updateInfo | Get-DownOSDUpdate -DownloadPath $path
sl $path -Verbose
set-content -path .\LatestFile.txt -value ([IO.Path]::Combine($path, $updateInfo."Title", $updateInfo."FileName")) -Force
}
fGetUpdates -arch x64 -SLCU SSU -BuildNummer 1909
fGetUpdates -arch x64 -SLCU LCU -BuildNummer 1909
Die Funktion fGetUpdates
stellt die Möglichkeit bereit, die SSU und LCU-Updates gezielt die angegegebenen CAB-Dateien herunterzuladen. Diese werden nach vollständigen Herunterladen weiterverarbeitet. Dies geschieht unter anderem mit dem DISM-Befehl in Windows 10:
dism /online /Add-Package /PackagePath:"C:\SetupDeployment\Updates\Windows 10\1909\SSU\2019-11 Servicing Stack Update for Windows 10 Version 1909 for x64-based Systems (KB4524569)\Windows10.0-KB4524569-x64.cab"
Last updated
Was this helpful?