Fun Fact: SPE adds properties to items returned by Get-Item
and Get-ChildItem
(referred to as automatic properties. With automatic properties your code can change from $item.Fields["Title"].Value
to $item.Title
.
Since we want the raw version of the field, we will need to populate the report using the raw field. In the standard Sitecore API you can access the raw field using the Fields
collection.
Example: The following access the raw field value.
$item.Fields["Title"]
Example: The following demonstrates the changes to the script to access the raw values (denoted by $_.Fields["FIELDNAME"]
).
$templateId = "{76036F5E-CBCE-46D1-AF0A-4143F9B557AA}"
Get-Item -Path master: -Query "/sitecore/content/Home//*[@@templateid='$($templateId)']" |
Show-ListView -Property ID,Name, @{name="__Created";expression={$_.Fields["__Created"]}},FullPath

Note: Incase you were curious, the datetime properties are formatted with the command [Sitecore.DateUtil]::IsoDateToDateTime()
.