Created
September 9, 2022 12:59
-
-
Save JimMoyle/11d843561ab7e37e779390405facdaef to your computer and use it in GitHub Desktop.
Get FSLogix Disk Compaction Information from Event Log
This file contains 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
$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