Skip to content

Instantly share code, notes, and snippets.

@JimMoyle
Created September 9, 2022 12:59
Show Gist options
  • Save JimMoyle/11d843561ab7e37e779390405facdaef to your computer and use it in GitHub Desktop.
Save JimMoyle/11d843561ab7e37e779390405facdaef to your computer and use it in GitHub Desktop.
Get FSLogix Disk Compaction Information from Event Log
$diskCompactionEvents = Get-WinEvent -FilterHashtable @{
LogName = 'Microsoft-FSLogix-Apps/Operational'
ID = 57
}
foreach ($event in $diskCompactionEvents) {
$out = [PSCustomObject]@{
ImagePath = $event.Properties[0].Value
'TimeTaken(ms)' = $event.Properties[7].Value
'InitialSize(MB)' = $event.Properties[4].Value
'FinalSize(MB)' = $event.Properties[5].Value
'SpaceSaved(MB)' = $event.Properties[6].Value
}
Write-Output $out
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment