Created
November 10, 2018 14:19
-
-
Save AdamNaj/eca5d3df0f37147805dc010711eb7dc3 to your computer and use it in GitHub Desktop.
Querying Habitat Legal Site for Tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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