Collections:
Other Resources:
Cmdlet Output Object List in Windows PowerShell
What is the output object list of a cmdlet in Windows PowerShell?
✍: FYIcenter.com
Many cmdlets do return a list of objects, not just a single object.
If there is no more cmdlet in the cmdlet pipeline, the output object list will converted to a text table with properties of each object displayed as fields in a row.
For example, cmdlet "get-service" will return a list of ServiceController objects.
PS C:\fyicenter> get-service sql* Status Name DisplayName ------ ---- ----------- Stopped SQLAgent$SQLEXP... SQL Server Agent (SQLEXPRESS) Stopped SQLBrowser SQL Server Browser Stopped SQLWriter SQL Server VSS Writer
If there is a next cmdlet in the cmdlet pipeline, the entire list of objects will be passed to the next cmdlet for further processing:
PS C:\fyicenter> get-service sql* | format-list
Name : SQLAgent$SQLEXPRESS
DisplayName : SQL Server Agent (SQLEXPRESS)
Status : Stopped
DependentServices : {}
ServicesDependedOn : {MSSQL$SQLEXPRESS}
CanPauseAndContinue : False
CanShutdown : False
CanStop : False
ServiceType : Win32OwnProcess
Name : SQLBrowser
DisplayName : SQL Server Browser
Status : Stopped
DependentServices : {}
ServicesDependedOn : {}
CanPauseAndContinue : False
CanShutdown : False
CanStop : False
ServiceType : Win32OwnProcess
Name : SQLWriter
DisplayName : SQL Server VSS Writer
Status : Stopped
DependentServices : {}
ServicesDependedOn : {}
CanPauseAndContinue : False
CanShutdown : False
CanStop : False
ServiceType : Win32OwnProcess
⇒ "Sort-Object" Cmdlet in Windows PowerShell
⇐ Cmdlet Pipeline Patterns in Windows PowerShell
2016-11-04, ∼2835🔥, 0💬
Popular Posts:
What is the startup program "Windows Security notification icon - SecurityHealthSystray.ex e"on my W...
What is service "AEADIFilters" and program "AEADISRV.EXE" on Windows Vista? "AEADIFilters" is a syst...
How to remove BTTray.exe from startup program list? If you are not using any bluetooth devices, you ...
Can I remove startup application "exec.exe - NetZero Dialup ZCast" to speedup my computer and reduce...
How to use "query user" to find out who is logged in to my Windows 7 computer? If you allow remote l...