Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

powershell

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?

like image 899
AJ. Avatar asked Jun 29 '09 18:06

AJ.


1 Answers

You can also try Format-Table -wrap. For example:

(get-process -id 3104).startinfo.EnvironmentVariables | Format-Table -wrap
like image 190
FPardo Avatar answered Nov 16 '22 03:11

FPardo