PowerShell_Scripts/HomeAssistant/Get-HAPath.ps1

7 lines
333 B
PowerShell

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