Fixes
+ ConvertTo-Zip: Added -MuteSkipped * sz-df sorting fixed + -PassThru added, defaulting output to Format-Table unless -PassThru switch is specified which will output the objects raw. * Edit-DockerCompose fixed duplicate 'AdditionalFiles' * dcup and dcreup fixed: added --remove-orphans
This commit is contained in:
parent
3d57308616
commit
e2fe1a8f06
5 changed files with 35 additions and 16 deletions
|
@ -1,4 +1,4 @@
|
|||
param([ValidateSet('KB','GB','TB')]$SizeUnitName = 'GB')
|
||||
param([ValidateSet('KB','GB','TB')]$SizeUnitName = 'GB',[switch]$NoFilter,[switch]$PassThru)
|
||||
$local:zpool_cmd = $null
|
||||
$local:excludeType = ''
|
||||
|
||||
|
@ -21,16 +21,33 @@ function NewDataRow{param($Size,$Used,$Available,$Percent,$Source,$FSType,$Targe
|
|||
}
|
||||
}
|
||||
|
||||
Set-Alias Out-Default Format-Table
|
||||
if( $PassThru ) {
|
||||
Get-Item alias:/Out-Default | Remove-Item
|
||||
}
|
||||
|
||||
$local:filterParam = [ordered]@{}
|
||||
if( -not $NoFilter ) { $filterParam.First = 1 }
|
||||
$local:df = @()
|
||||
& df '--output=size,used,avail,pcent,source,fstype,target' |
|
||||
Select-Object -Skip 1 | ForEach-Object {
|
||||
$local:df = $_.Split(' ', [StringSplitOptions]::RemoveEmptyEntries)
|
||||
NewDataRow $df[0] $df[1] $df[2] $df[3] $df[4] $df[5] $df[6]
|
||||
} |
|
||||
Group-Object -Property FSType |
|
||||
ForEach-Object {
|
||||
if( $_.Name -eq 'zfs' ) { $_.Group | Group-Object -Property Group | ForEach-Object { $_.Group | Select-Object -First 1 } }
|
||||
else { $_.Group }
|
||||
} |
|
||||
Select-Object -Property "Size$SizeUnitName","Used$SizeUnitName","Available$SizeUnitName",'Used%',Source,FSType,Target |
|
||||
Sort-Object -Property FSType,Target
|
||||
|
||||
$(
|
||||
& df '--output=size,used,avail,pcent,source,fstype,target' |
|
||||
Select-Object -Skip 1 | ForEach-Object {
|
||||
$local:df = $_.Split(' ', [StringSplitOptions]::RemoveEmptyEntries)
|
||||
NewDataRow $df[0] $df[1] $df[2] $df[3] $df[4] $df[5] $df[6]
|
||||
} |
|
||||
Sort-Object -Property FSType,Target |
|
||||
Group-Object -Property FSType |
|
||||
ForEach-Object {
|
||||
if( $_.Name -eq 'zfs' ) {
|
||||
$_.Group |
|
||||
Group-Object -Property Group |
|
||||
ForEach-Object {
|
||||
$_.Group | Sort-Object -Property Source | Select-Object @filterParam
|
||||
}
|
||||
}
|
||||
else { $_.Group }
|
||||
} |
|
||||
Select-Object -Property "Size$SizeUnitName","Used$SizeUnitName","Available$SizeUnitName",'Used%',Source,FSType,Target
|
||||
) |
|
||||
Out-Default
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue