Formatting Assistance

Hi Community,

I am trying to get the below to output into a more readable format - perhaps to Out-gridview

$services = Get-Service

$services | Where-Object {$.requiredservices} | Select-Object -Property name, @{n=‘requiredservices’; e={$}}, @{n=‘Status’;e={$_.requiredservices.status}}

I would like to try and get requiredservices and status to ‘ungroup’ and be on a separate line each so AppIDSvc would have 3 x lines with each required service and status? Any ideas appreciated

Name requiredservices Status

AppIDSvc {RpcSs, CryptSvc, AppID} {Running, Running, Stopped}
Appinfo {RpcSs, ProfSvc} {Running, Running}
AudioEndpointBuilder PlugPlay Running
AudioSrv {MMCSS, RpcSs, AudioEndpointBuilder} {Stopped, Running, Running}
AxInstSV rpcss Running
BFE RpcSs Running
BITS {RpcSs, EventSystem} {Running, Running}
Browser {LanmanServer, LanmanWorkstation} {Running, Running}

Below works for me. Let me know what you think.

Get-Service | ForEach-Object {
    if ($_.RequiredServices) {
        foreach ($service in $_.RequiredServices) {
            [PSCustomObject] @{
                'Name' = $_.Name
                'RequiredService' = $service.Name
                'Status' = $service.Status

Hey Daniel,

works for me as well - thanks so much