Last active
January 28, 2021 11:16
-
-
Save Stephanevg/dc2d5838dd8b92a76aec54fb047ffd3c to your computer and use it in GitHub Desktop.
Function to get servicing stack information from WSUS server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-ServicingStackInfos { | |
Param( | |
) | |
$Hash = @{} | |
$Updates = Get-WsusUpdate | |
Foreach($Update in $Updates){ | |
#2021-01 Servicing Stack Update für Windows Server 2019 für x64-basierte Systeme (KB4598480) | |
If($update.update.title -like '*servicing*' ){ | |
If($update.Update.title -match "(?'Date'\d{4}-\d{2})(?'Title'.*)\((?'KbNumber'KB\d{7})\)$"){ | |
$Hash.ReleaseDate = $Matches.Date | |
$Hash.Title = $Matches.Title | |
$Hash.KBNumber = $Matches.KbNumber | |
$Hash.Products = $Update.Products | |
} | |
} | |
} | |
New-Object psobject -Property $Hash | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment