Last active
March 20, 2019 03:55
-
-
Save OSDeploy/b579319922247883b7e6b8e9b078fe4b to your computer and use it in GitHub Desktop.
Returns LCU Installations in your OS
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
[xml]$SessionsXml = Get-Content -Path "$env:WinDir\Servicing\Sessions\Sessions.xml" | |
$Sessions = $SessionsXml.Sessions.Session | ` | |
Where-Object {$_.Tasks.Phase.package.id -like "*RollupFix*" -and $_.Tasks.Phase.package.targetState -eq 'Installed'} | |
$InstalledLCU = @() | |
foreach ($Session in $Sessions) { | |
$obj = $null | |
$obj = New-Object System.Object | |
$obj | Add-Member -type NoteProperty -Name Complete -Value $Session.Complete | |
$obj | Add-Member -type NoteProperty -Name Package -Value $Session.Tasks.Phase.Package.id | |
$InstalledLCU += $obj | |
} | |
$InstalledLCU |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment