Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Querying Habitat Legal Site for Tags
gci -path 'master:\content\Habitat sites\Habitat Legal\Home\News' |
%{ [PSCustomObject]@{ Name=&{$_.Title};
Author=&{@( $_.PSFields.Author.Items |
%{ gi master: -id $_ } |
%{ "$($_._Name) ($($_.JobTitle))" }) -join ", "};
Tags=&{@( $_.PSFields.SxaTags.Items |
%{ gi master: -id $_ } |
%{ $_.Name }) -join ", "}
} } | ft -prop @{name="Name"; width=50; Expression={$_.Name}},
@{name="Author"; width=60; Expression={$_.Author}}, Tags
gci -path 'master:\content\Habitat sites\Habitat Legal\Home\our-team' |
%{ [PSCustomObject]@{ Name=&{$_._Name}; JobTitle=&{$_.JobTitle};
Tags=&{@( $_.PSFields.SxaTags.Items |
%{ gi master: -id $_ } |
%{ $_.Name }) -join ", "};
Author=&{@( $_.PSFields.Author.Items |
%{ gi master: -id $_ } |
%{ $_.Name }) -join ", "}
} } | ft #-auto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.