Last active
June 4, 2024 14:28
-
-
Save dsolovay/09b9ea453f950ebb1bae617c3915fdfd to your computer and use it in GitHub Desktop.
Get non-removed items from DB Cleanup log
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
param ([String]$LogPath) | |
$db = '' | |
foreach ($line in Get-Content $LogPath) | |
{ | |
if ($line -like '*Cleanup of resource items is started for *') { | |
$db = $line -replace '^.*Cleanup of resource items is started for ''(\w+)'' database.*$', '$1' | |
} | |
if ($line -like '*item {*} is modified.*') { | |
$id = $line -replace '^.*item {(.{36})} is modified.*$', '$1' | |
[PsCustomObject]@{ | |
"Database"=$db | |
"ItemID"=$id | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment