Bug fix for Get-DockerProcess
Get-Member would error when input was missing.
This commit is contained in:
parent
8cbb2e2252
commit
90bd351641
|
@ -12,11 +12,12 @@ $(docker ps -q) |
|
||||||
Status=$tmp.State.Status
|
Status=$tmp.State.Status
|
||||||
Image=$tmp.Config.Image
|
Image=$tmp.Config.Image
|
||||||
Ports=$(
|
Ports=$(
|
||||||
$tmp.HostConfig.PortBindings |
|
if( $tmp.HostConfig -and $tmp.HostConfig.PortBindings ) {
|
||||||
Get-Member -type NoteProperty | Select-Object -ExpandProperty Name |
|
$tmp.HostConfig.PortBindings | Get-Member -type NoteProperty | Select-Object -ExpandProperty Name |
|
||||||
ForEach-Object {
|
ForEach-Object {
|
||||||
"$($tmp.HostConfig.PortBindings."$_".HostPort)/$_"
|
"$($tmp.HostConfig.PortBindings."$_".HostPort)/$_"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
Binds= $tmp.HostConfig.Binds
|
Binds= $tmp.HostConfig.Binds
|
||||||
raw = $tmp
|
raw = $tmp
|
||||||
|
|
Loading…
Reference in New Issue