![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Problem with Measure-Object on get-process Hi PowerScripters ! I have a strange problem when I run this command : get-process notepad | format-list * | measure-object The result is always : 5 Although when I just try "get-process notepad | format-list *" I have a lot of properties, and not only five ! What's the problem ? Arnaud PS: of course, the notepad is launched before... |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Problem with Measure-Object on get-process The format-* cmdlets are designed to be used only at the end of the pipeline, not in the middle. You can use something like this instead to measure properties: PS> get-process notepad | gm -membertype *property* | measure-object -- greetings dreeschkind "A. Petitjean" wrote: > Hi PowerScripters ! > > I have a strange problem when I run this command : > > get-process notepad | format-list * | measure-object > > The result is always : 5 > Although when I just try "get-process notepad | format-list *" I have a lot > of properties, and not only five ! > > What's the problem ? > > Arnaud > PS: of course, the notepad is launched before... |
My System Specs![]() |
| | #3 (permalink) |
| | RE: Problem with Measure-Object on get-process Oh and btw. "gm" is an alias for get-member. See: get-member -? -- greetings dreeschkind "dreeschkind" wrote: > The format-* cmdlets are designed to be used only at the end of the > pipeline, not in the middle. > You can use something like this instead to measure properties: > > PS> get-process notepad | gm -membertype *property* | measure-object > > -- > greetings > dreeschkind > > "A. Petitjean" wrote: > > > Hi PowerScripters ! > > > > I have a strange problem when I run this command : > > > > get-process notepad | format-list * | measure-object > > > > The result is always : 5 > > Although when I just try "get-process notepad | format-list *" I have a lot > > of properties, and not only five ! > > > > What's the problem ? > > > > Arnaud > > PS: of course, the notepad is launched before... |
My System Specs![]() |
| | #4 (permalink) |
| | RE: Problem with Measure-Object on get-process Thanks a lot ! It works ! Best regards from France. Arnaud "dreeschkind" wrote: > The format-* cmdlets are designed to be used only at the end of the > pipeline, not in the middle. > You can use something like this instead to measure properties: > > PS> get-process notepad | gm -membertype *property* | measure-object > > -- > greetings > dreeschkind > > "A. Petitjean" wrote: > > > Hi PowerScripters ! > > > > I have a strange problem when I run this command : > > > > get-process notepad | format-list * | measure-object > > > > The result is always : 5 > > Although when I just try "get-process notepad | format-list *" I have a lot > > of properties, and not only five ! > > > > What's the problem ? > > > > Arnaud > > PS: of course, the notepad is launched before... |
My System Specs![]() |
| | #5 (permalink) |
| | RE: Problem with Measure-Object on get-process And if you really care about these 5 objects that you've been measuring, see the output of this command: PS> get-process notepad | format-list * | gm -- greetings dreeschkind "A. Petitjean" wrote: > Thanks a lot ! It works ! > > Best regards from France. > > Arnaud > > "dreeschkind" wrote: > > > The format-* cmdlets are designed to be used only at the end of the > > pipeline, not in the middle. > > You can use something like this instead to measure properties: > > > > PS> get-process notepad | gm -membertype *property* | measure-object > > > > -- > > greetings > > dreeschkind > > > > "A. Petitjean" wrote: > > > > > Hi PowerScripters ! > > > > > > I have a strange problem when I run this command : > > > > > > get-process notepad | format-list * | measure-object > > > > > > The result is always : 5 > > > Although when I just try "get-process notepad | format-list *" I have a lot > > > of properties, and not only five ! > > > > > > What's the problem ? > > > > > > Arnaud > > > PS: of course, the notepad is launched before... |
My System Specs![]() |
| | #6 (permalink) |
| | RE: Problem with Measure-Object on get-process Ok, but who said that "the format-* cmdlets are designed to be used only at the end of the pipeline, not in the middle." ??? ;-) Arnaud "dreeschkind" wrote: > And if you really care about these 5 objects that you've been measuring, see > the output of this command: > > PS> get-process notepad | format-list * | gm > > -- > greetings > dreeschkind > > "A. Petitjean" wrote: > > > Thanks a lot ! It works ! > > > > Best regards from France. > > > > Arnaud > > > > "dreeschkind" wrote: > > > > > The format-* cmdlets are designed to be used only at the end of the > > > pipeline, not in the middle. > > > You can use something like this instead to measure properties: > > > > > > PS> get-process notepad | gm -membertype *property* | measure-object > > > > > > -- > > > greetings > > > dreeschkind > > > > > > "A. Petitjean" wrote: > > > > > > > Hi PowerScripters ! > > > > > > > > I have a strange problem when I run this command : > > > > > > > > get-process notepad | format-list * | measure-object > > > > > > > > The result is always : 5 > > > > Although when I just try "get-process notepad | format-list *" I have a lot > > > > of properties, and not only five ! > > > > > > > > What's the problem ? > > > > > > > > Arnaud > > > > PS: of course, the notepad is launched before... |
My System Specs![]() |
| | #7 (permalink) |
| | RE: Problem with Measure-Object on get-process Well, they are designed but not limited to be used at the end of the pipeline! ;-) It is not forbidden to use the format-* cmdlets in the middle of the pipeline, but in general you do not need/want this. The objects produced by the format-* cmdlets are consumed by the formatting engine. I just wanted to show you what is really going on behind the scenes in case you were wondering. -- greetings dreeschkind "A. Petitjean" wrote: > Ok, but who said that "the format-* cmdlets are designed to be used only at > the end of the pipeline, not in the middle." ??? ;-) > > Arnaud > > "dreeschkind" wrote: > > > And if you really care about these 5 objects that you've been measuring, see > > the output of this command: > > > > PS> get-process notepad | format-list * | gm > > > > -- > > greetings > > dreeschkind > > > > "A. Petitjean" wrote: > > > > > Thanks a lot ! It works ! > > > > > > Best regards from France. > > > > > > Arnaud > > > > > > "dreeschkind" wrote: > > > > > > > The format-* cmdlets are designed to be used only at the end of the > > > > pipeline, not in the middle. > > > > You can use something like this instead to measure properties: > > > > > > > > PS> get-process notepad | gm -membertype *property* | measure-object > > > > > > > > -- > > > > greetings > > > > dreeschkind > > > > > > > > "A. Petitjean" wrote: > > > > > > > > > Hi PowerScripters ! > > > > > > > > > > I have a strange problem when I run this command : > > > > > > > > > > get-process notepad | format-list * | measure-object > > > > > > > > > > The result is always : 5 > > > > > Although when I just try "get-process notepad | format-list *" I have a lot > > > > > of properties, and not only five ! > > > > > > > > > > What's the problem ? > > > > > > > > > > Arnaud > > > > > PS: of course, the notepad is launched before... |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| measure-object works interactively but not in script | PowerShell | |||
| Adding canonical aliases for Compare-Object, Measure-Object, New-Object | PowerShell | |||
| Default display for measure-object | PowerShell | |||
| measure-object {get-process} | PowerShell | |||
| Multiple errors in help for measure-object | PowerShell | |||