Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save BillCacy/60c38e6f10f5e236c3abed4aa1390982 to your computer and use it in GitHub Desktop.
Save BillCacy/60c38e6f10f5e236c3abed4aa1390982 to your computer and use it in GitHub Desktop.
Looks for all items with specified template name that have a value in the specified field
$root = gi master:// -id "{C557F52C-BDBA-4F3D-BAD0-E315AD39C9CB}"
$items = $root | ls -r | ?{$_.TemplateName -eq "<TEMPLATE NAME>"}
$fieldName = "<FIELD NAME>"
foreach($i in $items){
if(-not([string]::IsNullOrWhitespace($i.Fields[$fieldName]))){
$i.Name + " : " + $i.Fields[$fieldName].Value + " : " + $i.Paths.FullPath
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment