Browse Source

Update Sophia.psm1

pull/103/head
Dmitry Nefedov 4 years ago
committed by GitHub
parent
commit
f115f4989a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      Sophia/Sophia.psm1

7
Sophia/Sophia.psm1

@ -3703,11 +3703,11 @@ function TempFolder
}
"1"
{
Write-Verbose -Message $Localization.Skipped -Verbose
Write-Verbose -Message $Localization.SkippedSymbolic -Verbose
}
}
}
until ((Get-ChildItem -Path $env:LOCALAPPDATA\Temp -Force -ErrorAction Ignore | Measure-Object).Count -eq 0)
until (((Get-ChildItem -Path $env:LOCALAPPDATA\Temp -Force -ErrorAction Ignore | Measure-Object).Count -eq 0) -or ($Result -eq 1))
}
}
else
@ -3717,6 +3717,8 @@ function TempFolder
New-Item -Path $env:LOCALAPPDATA\Temp -ItemType SymbolicLink -Value $env:SystemDrive\Temp -Force
}
if (Get-Item -Path "C:\Users\Юлия\AppData\Local\Temp" -ErrorAction Ignore | Where-Object -FilterScript {$_.LinkType -eq "SymbolicLink"})
{
[Environment]::SetEnvironmentVariable("TMP", "$env:SystemDrive\Temp", "User")
[Environment]::SetEnvironmentVariable("TMP", "$env:SystemDrive\Temp", "Machine")
[Environment]::SetEnvironmentVariable("TMP", "$env:SystemDrive\Temp", "Process")
@ -3730,6 +3732,7 @@ function TempFolder
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" -Name TMP -PropertyType ExpandString -Value $env:SystemDrive\Temp -Force
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" -Name TEMP -PropertyType ExpandString -Value $env:SystemDrive\Temp -Force
}
}
"Default"
{
# Remove a symbolic link to the %SystemDrive%\Temp folder

Loading…
Cancel
Save