我正在尝试将powershell命令的输出存入一个数组,但似乎不起作用。实际上,我想使用行和列索引来访问输出。 例如:
$a=Get-Service
具有输出(部分)
Status Name DisplayName
------ ---- -----------
Stopped AeLookupSvc Application Experience
Stopped ALG Application Layer Gateway Service
Stopped AppIDSvc Application Identity
Running Appinfo Application Information
Stopped AppMgmt Application Management
我希望在第二行中提及DisplayName,例如:
$a[2][2]
它应该给出然后。
Application Layer Gateway Service
但这似乎没有起作用。 有人能帮忙吗?