Agreed, and I would generally do this with a pipeline, and use .NETs environment class to do the lookups (in the registry) rather than relying on env vars.

```powershell
$adk = @([Environment]::GetFolderPath('ProgramFilesX86'), [Environment]::GetFolderPath('ProgramFiles')) |
  % { Join-Path $_ 'Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64' } |
  ? { Test-Path  $_ } |
  Select-Object -First 1
```
A couple of notes about this:

* The `|` must be at the end of line to continue code to the next line. 
* The `$_` is the automatic variable -- the value of the item being processed in the pipeline.  In this case, we're enumerating a list of possible path strings.
* The indentation is purely a style thing. 
* '%' is shorthand for `ForEach-Object` and  `?` is shorthand for `Where-Object` which filters.  For maintenance, I typically write out the full cmdlet names everywhere *except* for those two cases because I think they're self-evident.  
* `Select-Object` will grab the first item if there is one, and won't error if it's an empty list by the time the pipeline gets to that point.