Try a fix for $env:Configuration not expanding.