Revert "Changed environment variable to no longer use ~"

This reverts commit 4c6c2c4552e488372daf1d479e8a6dcdf32bc280.
Changed environment variable to no longer use ~

AppData isn't necessarily a directory underneath $Home in some
environments. Changed to use DirectoryInfo.DirectoryName instead and
reverse the slashes.

Also fixed extraneous formatting caused by Visual Studio :-)