注:本篇文章,未在联系作者以及得到许可的情况下, 禁止以任何形式进行转载。
By:Anders Mail:katrina520@163.com
在多个栏目中显示数据
Get
-
Process
|
Format
-
Wide
换句话说,你回得到类似这样的信息:
alg apdproxy
asghost ati2evxx
ati2evxx atiptaxx
BTStackServer BTTray
btwdins csrss
ctfmon DLACTRLW
eabservr explorer
HP Wireless Assistant HPQTOA
~
1
hpqwmi hpqwmiex
另外,你也可以用 -column参数指定专栏的数目;这个命令显示四个栏目的进程信息:
(英文原文将Column参数写成Columns这一为错误,因在PS 1.0中测试 Format-Table : 找不到与参数名称“Columns”匹配的参数。所以译者将错误Columns更正为Column)
Get
-
Process
|
Format
-
Wide –column
4
如果任何一个进程名称长于所分配的栏目空间,这些名字将截断,所以(注意FastUserSwitching不太适合) :
FastUserSwitchin... helpsvc
hpqwmiex HTTPFilter
InoRPC InoRT
如果你不知道当你显示信息有多少栏目时,那为什么不能让Windows PowerShell数字为你指出?刚刚使用 - autosize参数和Windows PowerShell会计算最大的栏目数,可用于无截断数据:
Get
-
Process
|
Format
-
Wide –autosize
英文原文:http://www.microsoft.com/technet/scriptcenter/topics/msh/cmdlets/format-wide.mspx
本文介绍如何使用 PowerShell 的 Format-Wide cmdlet 来在多个栏目中展示数据,包括如何调整显示栏目的数量以及避免数据截断的方法。

被折叠的 条评论
为什么被折叠?



