Skip to content

Instantly share code, notes, and snippets.

@Jaykul
Created September 17, 2019 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jaykul/0231b0236bfc39117ad0b33468570fea to your computer and use it in GitHub Desktop.
Save Jaykul/0231b0236bfc39117ad0b33468570fea to your computer and use it in GitHub Desktop.
Formatting InformationRecord does not work
<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
<ViewDefinitions>
<View>
<Name>InformationRecord</Name>
<OutOfBand />
<ViewSelectedBy>
<TypeName>System.Management.Automation.InformationRecord</TypeName>
</ViewSelectedBy>
<CustomControl>
<CustomEntries>
<CustomEntry>
<CustomItem>
<ExpressionBinding>
<ScriptBlock>
$_.MessageData | Format-List * | Out-String
</ScriptBlock>
</ExpressionBinding>
<ExpressionBinding>
<ScriptBlock>
"Tags: " + @($_.Tags -join ", ")
</ScriptBlock>
</ExpressionBinding>
<ExpressionBinding>
<ScriptBlock>
$_ | Select-Object * -ExcludeProperty Tags, MessageData | Format-List * -Force | Out-String
</ScriptBlock>
</ExpressionBinding>
</CustomItem>
</CustomEntry>
</CustomEntries>
</CustomControl>
</View>
</ViewDefinitions>
</Configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment