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