I need to use the Get-Eventlog cmdlet to display just the log name and the retention period. I've used Get-Eventlog -list | format-table log, retain
but it only displays the log and the "retain" column is empty. What is the parameter for the retention period so the numbers will display along with the log name? Thanks
Powershell – Listing the parameters of Get-Eventlog cmdlet
powershell
Related Topic
- PowerShell: Copy-GPO failing with HRESULT: 0x8007000D
- Powershell – How to list out Virtual Directories in IIS from the all the websites in PowerShell
- Powershell – Test-Cluster Powershell cmdlet List vs Validate
- Powershell – Active Directory Module for PowerShell Get-ADObject and Set-ADObject don’t work with custom attribute
- Powershell – expanding powershell cmdlet group-object
- Powershell – Get-GPResultantSetOfPolicy throws “…the report cant be generated for user…”
Best Answer
The objects returned by
Get-EventLog
have no such property asRetain
. However, they do have a property namedMinimumRetentionDays
. Maybe that's what you're after. Just do aGet-EventLog -List | Select *
to see what all properties are available, so that you can avoid trying to select properties that don't exist.Get-EventLog -List | Select Log, MinimumRetentionDays