Fix dps and Get-HAPath

DPS -MatchAny should work better now
Get-HAPath refined
This commit is contained in:
Gal Szkolnik 2021-07-16 09:04:24 -04:00
parent 0a2bb25700
commit fd9b8a968c
2 changed files with 8 additions and 5 deletions

View File

@ -1,6 +1,9 @@
if( $HAConfigPath ) { return $HAConfigPath }
@(
$(
@($HAConfigPath,'/srv/ha/current/homeassistant','/usr/share/hassio/homeassistant') | Where-Object { Test-Path -Type Container $_ } | Select-Object -First 1
), '/srv/ha/current/homeassistant'
) | Where-Object { $_ } | Select-Object -First 1 -OutVariable HAConfigPath
@($HAConfigPath,'/srv/ha/current/homeassistant','/usr/share/hassio/homeassistant') |
Where-Object { $_ } |
Where-Object { Test-Path -Type Container $_ } |
Select-Object -First 1
), $HAConfigPath, '/srv/ha/current/homeassistant'
) | Where-Object { $_ } |
Select-Object -First 1 -OutVariable HAConfigPath

View File

@ -32,7 +32,7 @@ if( $MatchName ) {
}
if( $MatchAny ) {
$result = $result | Where-Object { $_ | Out-String | Where-Object { $_ -match $($MatchAny -join '|') } }
$result = $result | Where-Object { $_ | Format-Table -Wrap -HideTableHeaders | Out-String | Where-Object { $_ -match $($MatchAny -join '|') } }
}
if( $OrderBy ) {