I need to convert PSObject to String(). Is there any standard way available to do this task? Somehow powershell also does ToString() or spits out a readable stream on ISE console. I used PSSerializer.Serialize(PSObject) but it serializes everything. I want in my application seemlessly everything shown in a way the way Powershell does.
Is there anyway to convert PSObject to a.readable string. At the moment when I use following line of code
PSObject.ToString()
or
PSObject.BaseObject.ToString()
both just print out complete type name. ( e.g. "System.Collection.HashTable" ) But I want complete displayed contents to see the way powershell exposes.C#