Get-PnPProperty Add line to Output

ComputerHabit 861 Reputation points
2020-08-30T01:59:34.833+00:00

I'm trying to add a line to this array. I just can't seem to figure it out. Normally I'd just use += but that doesn't work on this. It says it's an array but isn't acting like it. Maybe it's an array of object so or something but I'm at a loss as to the right words to lookup to learn about it.

$fields = (Get-PnPProperty -clientobject $contenttype -property "Fields") | where{$_.InternalName -ne "ContentType" -and $_.InternalName -ne "Form_x0020_Status"}

It shows like this:

Title                           InternalName                     Id                                  
-----                           ------------                     --                                  
Title                           Title                            fa564e0f-0c70-4ab9-b863-0177e6ddd247
Employee Type                   Employee_x0020_Account_x0020_Typ d7a9653e-8724-4982-b913-93919da179ec

When I try to add anything it fails or ends up in some weird line after it.

Comments                        _Comments                        52578fc3-1f01-4f4d-b016-94ccbcf428cf

Title        : whatever
InternalName : this
Id           : 12334

How do I add a line to this.

Microsoft Office Online Server
Microsoft Office Online Server
Microsoft on-premises server product that runs Office Online. Previously known as Office Web Apps Server.
611 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,445 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 33,376 Reputation points Microsoft Vendor
    2020-08-31T06:49:39.127+00:00

    Hi
    As per my understanding, you've create an object like

    $myobject = [PSCustomObject]@{
    Title= 'Whatever'
    InternalName  = 'this'
    Id = 12345
    } 
    

    Do you want to add it to the output not in a table, but still in a line to keep the format, like this

    $fields | Select-Object -Property Title,InternalName,Id; $myobject | Select-Object -Property Title,InternalName,Id
    

    Best Regards
    Ian


    Please remember to "Accept Answer" and upvote if the reply is helpful.

    0 comments No comments

0 additional answers

Sort by: Most helpful