Tweaks and fixes
Improved sz-df output of zfs mounts Removed PowerShellCookbook dependecy in Packagesz class
This commit is contained in:
parent
c6cc116564
commit
8b2a4ca0cb
|
@ -23,9 +23,9 @@ $local:df = @()
|
||||||
Select-Object -Skip 1 | ForEach-Object {
|
Select-Object -Skip 1 | ForEach-Object {
|
||||||
$local:df = $_.Split(' ', [StringSplitOptions]::RemoveEmptyEntries)
|
$local:df = $_.Split(' ', [StringSplitOptions]::RemoveEmptyEntries)
|
||||||
NewDataRow $df[0] $df[1] $df[2] $df[3] $df[4] $df[5] $df[6]
|
NewDataRow $df[0] $df[1] $df[2] $df[3] $df[4] $df[5] $df[6]
|
||||||
} | Where-Object {
|
} | Where-Object {
|
||||||
-not ($_.FSType -eq 'zfs' -and $_.Source -match '/')
|
$_.FSType -notin 'squashfs' -and $_.Target -notin 'zfs' -and ($_.FSType -ne 'zfs' -xor ($_.Source -match '^[^/]+(?:/[^/]+)$' -or $_.Target -match '^(?:/[^/]+)$'))
|
||||||
} | Sort-Object -Property Target
|
} | Sort-Object -Property FSType,Target
|
||||||
|
|
||||||
#$zpool_cmd = get-command zpool | Where-Object CommandType -eq 'Application' | Select-Object -ExpandProperty Source
|
#$zpool_cmd = get-command zpool | Where-Object CommandType -eq 'Application' | Select-Object -ExpandProperty Source
|
||||||
#if( $zpool_cmd ) {
|
#if( $zpool_cmd ) {
|
||||||
|
|
|
@ -38,7 +38,7 @@ class Packagesz { #: System.Management.Automation.IValidateSetValuesGenerator {
|
||||||
$v = $v -and $($c.Username | Where-Object { $username -match $_ })
|
$v = $v -and $($c.Username | Where-Object { $username -match $_ })
|
||||||
}
|
}
|
||||||
if( $v -and $c.custom ) {
|
if( $v -and $c.custom ) {
|
||||||
$v = $v -and ([bool]$(Invoke-ScriptBlock ([ScriptBlock]::Create($c.custom))))
|
$v = $v -and ([bool]$(& ([ScriptBlock]::Create($c.custom))))
|
||||||
}
|
}
|
||||||
switch( $c.Logic ) {
|
switch( $c.Logic ) {
|
||||||
[szLogic]::not { $valid = $valid -and -not $v }
|
[szLogic]::not { $valid = $valid -and -not $v }
|
||||||
|
|
Loading…
Reference in New Issue