Az objektumok részletesebb vizsgálatára felhasználható a format-custom cmdlet. Ez a bemeneteként kapott objektum tulajdonságait részletesen kiírja, ezen kívül az objektum és tulajdonságainak típusát (osztályát) is megjeleníti:
[1] PS C:\> Get-Service wuauserv | Format-Custom -Property *
class ServiceController
{
Name = wuauserv
RequiredServices =
[
class ServiceController
{
Status = Running
Name = rpcss
DisplayName = Remote Procedure Call (RPC)
}
]
CanPauseAndContinue = False
CanShutdown = True
CanStop = True
DisplayName = Windows Update
DependentServices =
[
]
MachineName = .
ServiceName = wuauserv
ServicesDependedOn =
[
class ServiceController
{
Status = Running
Name = rpcss
DisplayName = Remote Procedure Call (RPC)
}
]
ServiceHandle =
class SafeServiceHandle
{
IsInvalid = False
IsClosed = False
}
Status = Running
ServiceType = Win32ShareProcess
Site =
Container =
}
Óvatosan bánjunk ezzel a megjelenítési lehetőséggel, hiszen ha nagyon összetett adattípust iratunk így ki, a kimenet nagyon szószátyár is lehet. Óvatosságból használjuk a Depth paramétert:
[10] PS C:\> $f = Get-Item C:\munka\futók.txt
[11] PS C:\> $f | Format-Custom -Depth 1
class FileInfo
{
LastWriteTime =
class DateTime
{
Date = 2009. 11. 21. 0:00:00
Day = 21
DayOfWeek = Saturday
DayOfYear = 325
Hour = 19
Kind = Local
Millisecond = 815
Minute = 45
Month = 11
Second = 20
Ticks = 633944295208158750
TimeOfDay = 19:45:20.8158750
Year = 2009
DateTime = 2009. november 21. 19:45:20
}
Length = 254
Name = futók.txt
}
Enélkül a fenti példában minden egyes datetime és timespan tulajdonság külön kibontásra került volna.
PowerShell 3.0 verziótól kezdve alternatív megoldásként a JSON formátumot is használhatjuk az objektumok vizsgálatára, amit a ConvertTo-JSON cmdlettel kaphatunk meg:
PS C:\> Get-Service wuauserv | ConvertTo-Json
{
"CanPauseAndContinue": false,
"CanShutdown": true,
"CanStop": true,
"DisplayName": "Windows Update",
"DependentServices": [
],
"MachineName": ".",
"ServiceName": "wuauserv",
"ServicesDependedOn": [
{
"CanPauseAndContinue": false,
"CanShutdown": false,
"CanStop": false,
"DisplayName": "Remote Procedure Call (RPC
)",
"DependentServices": null,
"MachineName": ".",
"ServiceName": "rpcss",
"ServicesDependedOn": "DcomLaunch RpcEptMa
pper",
…
Ennek előnye, hogy kevesebb sallangot tartalmaz, könnyebb áttekinteni az információkat, nem beszélve arról, hogy ez a formátum szabványos, így akár más rendszerek közti adatcserére is felhasználható.