The Toolkit variable $envTemp provides incorrect information.
Example :
Copy-File -Path "$dirSupportFiles\*.*” -Destination "$envTemp\tempfiles"
returns
Copy-File -Path …\supportfiles\*.* -Destination ...\Temp\\tempfiles
return with an extra \ after temp
Workaround:
$env:Temp
It is not a bug it just might not be what you expected.
$envTemp is a result of calling GetTempPath, which returns the first working path in this list:
- The path specified by the TMP environment variable.
- The path specified by the TEMP environment variable.
- The path specified by the USERPROFILE environment variable.
- The Windows directory.
Correct.
Open powershell and run than [IO.Path]::GetTempPath()
Result C:\WINDOWS\TEMP\
In the toolkit you cannot use $envtemp\BackUp this gives you after result of calling GetTempPath() c:\Temp\\Backup
Just tested it. Returns correct value running under user admin. Other than trailing backslash in the variables I see no issue here.
Running under system yields similar results.