We would like to show custom data such as custom string(" Test Case 1","Test case 2"). All these data do not inside any items in Sitecore. It is just a string in powershell script and would like to show in Show-ListView.

We would like to add one column inside Show-ListView and show data under this column.

Is this possible? Kindly assist someone on this.

  • Have you reviewed the documentation? What have you tried? Sep 28, 2021 at 5:52
  • Yes I have reviewed the document and I have tried with property and ViewName
    – Ashish
    Sep 28, 2021 at 8:09

1 Answer 1


1. Using PSCustomObject in array

$list = [System.Collections.ArrayList]@()

in for each loop assign value to info object and then add it to list

$info = [PSCustomObject]@{
                            "data1"="test 1"
                            "data2" = "test data 2"

then show it finally

$list | Show-ListView

2. Using Class, example given below:

class Topics {

create its array object

[Topics[]]$AllTopics = @()

assign values to it

$topicfolders|get-childitem |foreach-object{
    $topic=       [Topics]@{
           TopicId =  $_.Id
           TopicPath= $_.fullpath
           TopicName =  $_.name
            $AllTopics =[Array] $AllTopics +  $topic
#then show $AllTopics 

3. Directly assign value to psobject and show that

$customItem = [pscustomobject]@{
    "__Updated by"=$Item."__Updated by"

$customItem | Show-ListView

4.using Expression of show-listview, either give your value in it or create a function and use that to get values.

  • I have resolved it by adding [PSCustomObject]. Only change is here $info = [PSCustomObject]@{ data1="test 1" data2 = "test data 2" } $info | Show-ListView
    – Ashish
    Sep 28, 2021 at 9:58
  • Great, please accept comment as answer if that helped.
    – Rinku Jain
    Sep 28, 2021 at 14:43

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.