Is there a way to wordwrap results of a Powershell cmdlet?

powershell

Solution

Output in table structures are auto-formatted to fit the width of the screen, truncating long values in the process if necessary.

Pipe the results into the `format-list` command to get verbose, vertical formatting of the results.

PS> $object | get-member MethodWithLongSignature | format-list

Problem

Simple (probably stupid) question. I'm a Powershell novice and am mainly using it to instantiate managed libraries so I don't have to write little apps when I need to use members from them. Some of these libraries are old and have methods with long, painful signatures. Using get-member after instantiating with new-object, I've often run into frustrating results like this: ``` PS> $object | get-member MethodWithLongSignature TypeName: SomeLib.SomeObject Name MemberType Definition ---- ---------- ---------- MethodWithLongSignature Method System.Void MethodWithLongSignature(string param1, int param2, string param3, string param4, stri.... ``` Is there any way to wrap the results of get-member? Alternatively, is there a switch for get-member that will produce the results in a manner that won't wrap?

Original source

Related problems