Want to write a powershell script using the utility AFDIag.exe to clean up EventFrames in the AF Database. I have something like below which uses a "purge" date but I want to use Template names. Is there example of the expected format for the command? Can you use wildcards in the template name?
I have this for a date based clean up
#Get the adjusted date and format it for AFDiag
$dte = Get-Date
$dte = $dte.AddDays(-$numberOfDaysToKeep).ToString("yyyy-MM-dd")
#Change to D drive and get to the AF Directory
#Delete event frames that ended prior to $dte
$OutputDEF = .\AFDiag.exe /DeleteEventFrames:$dte /Yes | Out-String
Can I do something like:
$OutputDEF = .\AFDiag.exe /DeleteEventFrames /Database:$db /Template:$templateName /Yes | Out-String
Where @db = database name and $templateName is the name of the templates I want to clean up. Again, I use a wild card in the name?