# make sure the property gets piped to Out-String to turn its # content into readable text that can be displayed in the report $replacementStrings = @{ Name = 'ReplacementStrings' Expression = { ($_.ReplacementStrings | Out-String).Trim() } }
Get-EventLog-LogName System -EntryType Error -After$startDate | # select the properties to be included in your report Select-Object-Property EventId, Message, Source, InstanceId, TimeGenerated, $ReplacementStrings, UserName | ConvertTo-Html | Set-Content-Path$Path
# make sure the property gets piped to Out-String to turn its # content into readable text that can be displayed in the report $replacementStrings = @{ Name = 'ReplacementStrings' Expression = { $_.ReplacementStrings -join',' } }
Get-EventLog-LogName System -EntryType Error -After$startDate | # select the properties to be included in your report Select-Object-Property EventId, Message, Source, InstanceId, TimeGenerated, $ReplacementStrings, UserName | ConvertTo-Html | Set-Content-Path$Path