我能用Windows PowerShell做什么:把数据显示成一个列表
2007-09-14 21:34
253 查看
注:本篇文章,未在联系作者以及得到许可的情况下, 禁止以任何形式进行转载。
By:Anders Mail:katrina520@163.com
把数据显示成一个列表
许多cmdlets (Get-Service,如这个命令),显示信息的表格形式。也许有时候,当你想把数据信息显示成一个列表的时候(特别是如果这个表格有太多的栏目,以很好的适合屏幕)。也许正如你所期望的,这个format-List cmdlet在这里作为一个列表的形式来帮你显示信息。
首先,这里用Get-Service cmdlet默认输出,像这个样子:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Status Name DisplayName
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
------ ---- -----------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Running AdobeActiveFile... Adobe Active File Monitor V4
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Stopped Alerter Alerter
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Running ALG Application Layer Gateway Service
当你通过用Format-List获得输出时就像这个样子:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Name : Spooler
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
DisplayName : Print Spooler
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Status : Running
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
DependentServices : {}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
ServicesDependedOn : {RPCSS}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
CanPauseAndContinue : False
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
CanShutdown : True
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
CanStop : True
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
ServiceType : Win32OwnProcess, InteractiveProcess
大家可以看到,任何时候你使用Get-Service只要三个属性值就好在Windows PowerShell中显示一个表格。用Get-Service时一个方法可以得到所有有效的属性以及他们的值并且用Format-List输出。
这是一个很好的问题:我们如何用Format-List输出格式名单?这里:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Get-Service | Format-List
它是那么的简单。
英文原文:http://www.microsoft.com/technet/scriptcenter/topics/msh/cmdlets/format-list.mspx
By:Anders Mail:katrina520@163.com
把数据显示成一个列表
许多cmdlets (Get-Service,如这个命令),显示信息的表格形式。也许有时候,当你想把数据信息显示成一个列表的时候(特别是如果这个表格有太多的栏目,以很好的适合屏幕)。也许正如你所期望的,这个format-List cmdlet在这里作为一个列表的形式来帮你显示信息。
首先,这里用Get-Service cmdlet默认输出,像这个样子:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Status Name DisplayName
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
------ ---- -----------
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Running AdobeActiveFile... Adobe Active File Monitor V4
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Stopped Alerter Alerter
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Running ALG Application Layer Gateway Service
当你通过用Format-List获得输出时就像这个样子:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Name : Spooler
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
DisplayName : Print Spooler
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Status : Running
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
DependentServices : {}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
ServicesDependedOn : {RPCSS}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
CanPauseAndContinue : False
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
CanShutdown : True
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
CanStop : True
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
ServiceType : Win32OwnProcess, InteractiveProcess
大家可以看到,任何时候你使用Get-Service只要三个属性值就好在Windows PowerShell中显示一个表格。用Get-Service时一个方法可以得到所有有效的属性以及他们的值并且用Format-List输出。
这是一个很好的问题:我们如何用Format-List输出格式名单?这里:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Get-Service | Format-List
它是那么的简单。
英文原文:http://www.microsoft.com/technet/scriptcenter/topics/msh/cmdlets/format-list.mspx
相关文章推荐
- 我能用Windows PowerShell做什么:在多个栏目中显示数据
- Android采用ListView实现数据列表显示
- Silverlight 教程第五部分:用 ListBox 和 DataBinding 显示列表数据
- ListView listCtrl 不能显示和不能正确添加行数据以及列表题不能显示问题
- 数据表格 - DataGrid - 列表显示
- EXT下拉列表中无法显示数据问题 ext undefined为空或不是对象
- 微信小程序--(5-1)点击列表item,把item上面显示的所有数据,传递到另外一个页面
- Android学习_19_采用ListView实现数据列表显示
- Android采用ListView三种显示数据列表(附源码)
- 短信列表如何让同一个号码的短信只显示一条,刚刚加载短信列表会加载所有的数据列。求指教
- 单击DataGrid的行,使这行的数据显示在这个页面的下面,有点像winform的一个列表,下面一个明细!!!^_^^_^^_^
- VC中ComboBox下拉列表不显示数据或只显示一行问题
- VC中点击ComboBox下拉列表不显示数据的解决方法
- hbuider 中点击就显示出一个单选的列表 ,然后后台跨域向里面动态添加数据,注意里面的格式是json object
- 用 ListBox 和 DataBinding 显示列表数据 (木野狐译)
- “空”的艺术-当数据为空时显示什么
- 对于导出页面上的列表出现某栏不显示数据的问题
- ThinkPHP备份数据( 先在页面列表内显示每个数据表名称,点击操作按钮【备份】对其备份)
- DataGridView依据下拉列表显示数据