I'm trying to write a simple Powershell script that finds all General Link fields and outputs the value of their Source field.

$fields = Get-ChildItem -Path "master://sitecore/templates/user defined" -Recurse | Where-Object { $_.TemplateName -eq "Template field" -and $_.Type -eq "General Link" }

foreach ($field in $fields) {
    Write-Host "Name: $($field.Name)"
    Write-Host "Source: $($field.Source)"

Whenever I run it, however, the value from the Source field is empty for all returned items.

Returned list of fields and empty sources

I've confirmed that it is populated in at least some of the cases, but it never shows up in the report. I've tried several variations to get the value, too:

$fields | Show-ListView -property `
    @{ Name="Path"; Expression={$_.Paths.Path} },
    @{ Name="Source"; Expression={$_.Source} },
    @{ Name="Source With Quotes"; Expression={$_."Source"} }


  • Sitecore version: 8.1 Update 3
  • Sitecore PowerShell Extensions version:

2 Answers 2


There is no Source property on Sitecore.Data.Items.Item class.

You need to get Source field value e.g. like this:

foreach ($field in $fields) {
    Write-Host "Name: $($field.Name)"
    Write-Host "Source: $($field._.Source.Value)"
  • 2
    This example is making use of a custom object SPE adds to the item. You can use _ or PSFields to get typed properties. Commented Feb 15, 2019 at 16:25

The issue is that the Source field is of type Template Field Source, which seems to not automatically emit a value if you simply access the field directly on the item ($field.Source).

Instead, you must get the field and get the value from that field:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.