Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TMP/TEMP env variable breaks ini.psm1 with non-ASCII usernames #391

Open
al-indigo opened this issue Mar 24, 2024 · 0 comments
Open

TMP/TEMP env variable breaks ini.psm1 with non-ASCII usernames #391

al-indigo opened this issue Mar 24, 2024 · 0 comments

Comments

@al-indigo
Copy link

al-indigo commented Mar 24, 2024

Images:
en-us_windows_server_2019_x64_dvd_f9475476 -- works fine
ru-ru_windows_server_2019_x64_dvd_e02b76ba -- breaks in ini.psm1 with the following error (see the screen)

  1. I have discovered the reason: PowerShell internally compiles this code. During this compilation, the .NET Framework may use TempFileCollection to create temporary files for the compilation process. That temp file is generated as a shortname and it seems that different parts of Windows do not understand these paths equally.
  2. I have found a workaround, but I do not know your code enough to propose a pull request for this and be sure that it will not break anything for other systems.

But my straightforward fix looks like inserting in Logon.ps1 code the following snippet after line 8 or in ini.psm1 in the beginning:

New-Item -Path $resourcesDir\Temp -ItemType Directory -Force | Out-Null
$ENV:TMP = "$resourcesDir\Temp"
$ENV:TEMP = "$resourcesDir\Temp"

Hope it helps and you will decide for yourselves how to fix it in the most correct way

psm-error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant