Various additions
dps is now an Alias to Get-DockerProcess Get-DockerProcess has been cleaned up and search features added to it. Added FromPowerShellCookbook, which loads a piece of code from the module, but does not load the entire module. MyConfig now includes ansible and tmux configs, also added -sudo switch Get-PlexInfo added, with ability to read directly from Server Invoke-ViaAnsible modified - cleaned up output Added -Force to Edit-DockerCompose dcc modified to read from raw log (which allows filtering by source, and has timestamps)
This commit is contained in:
parent
59a2949268
commit
ac9c5ed352
10 changed files with 80 additions and 20 deletions
24
Get-DockerProcess.ps1
Normal file
24
Get-DockerProcess.ps1
Normal file
|
@ -0,0 +1,24 @@
|
|||
#[CmdletBinding(SupportsShouldProcess)]param(
|
||||
[CmdletBinding()]param([string[]]$MatchName,[string[]]$OrderBy,[switch]$PassThru,[string[]]$MatchAny)
|
||||
|
||||
$local:result = $(docker ps --format='{{ .Image }}\t{{ .Names }}\t{{ .Status }}\t{{ .Ports }}' |
|
||||
ForEach-Object {
|
||||
$local:l = $_ -split '\t';
|
||||
[PSCustomObject]([ordered]@{Image=$l[0];Name=$l[1];Status=$l[2];Ports=$l[3] -replace ', ',"`n"})
|
||||
} ) | Sort-Object Name
|
||||
|
||||
if( $MatchName ) {
|
||||
$result = $result | Where-Object Name -match $($MatchName -join '|')
|
||||
}
|
||||
|
||||
if( $MatchAny ) {
|
||||
$result = $result | Where-Object { $_ | Out-String | Where-Object { $_ -match $($MatchAny -join '|') } }
|
||||
}
|
||||
|
||||
if( $OrderBy ) {
|
||||
$result = $result | Sort-Object $OrderBy
|
||||
}
|
||||
|
||||
if( $PassThru ) { return $result }
|
||||
$result | Format-Table -Wrap
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue