Quantcast
Channel: AutoSPInstaller
Viewing all articles
Browse latest Browse all 2279

Edited Issue: $env:TEMP does not work with certain usernames [19520]

$
0
0
__Description__
The file autospinstallerfunctionsmain.ps1 uses $env:TEMP to get the path to the current user's TEMP directory, but this does not work in some cases when the username has special characters (a dot in our case). This breaks the install since AutoSPInstaller writes and reads from files in the TEMP location.

__Example__
Username: DEV\sp.setup
$tempLocation = $env:TEMP

$tempLocation now contains C:\Users\SPF909~1.SET\AppData\Local\Temp\1. If you try to change to this directory it does not work in powershell, but it DOES work in cmd.exe.

__SOLUTION__
Use something like (Get-Item $env:TEMP).FullName instead of $env:TEMP. When using this syntax the $tempLocation variable above will contain "C:\Users\sp.setup\AppData\Local\Temp\1, i.e. a path that works with powershell.

Viewing all articles
Browse latest Browse all 2279

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>