It seems it's not going into this branch.

When I run `test -d $Env:SystemRoot` in the machine's shell I get exit status 1 (ie: fail).  When I run `test -d $SystemRoot` it works fine.

Is this working fine for you?