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