summaryrefslogtreecommitdiff
path: root/get
diff options
context:
space:
mode:
authorWindowsAddict2024-11-01 13:44:30 +0000
committerWindowsAddict2024-11-01 13:44:30 +0000
commit40d372b1b5f82a3a6664aeef716b84a4f538be1e (patch)
treeab008e00520bcb0a8c3ddb3cca3df1f93cde66bb /get
parent37c885bd76d7215ce20816b615c395366c9564d1 (diff)
downloadmassgravel.github.io-40d372b1b5f82a3a6664aeef716b84a4f538be1e.zip
Avoid temp variable
Diffstat (limited to 'get')
-rw-r--r--get4
1 files changed, 2 insertions, 2 deletions
diff --git a/get b/get
index 81ea36c..72d04e4 100644
--- a/get
+++ b/get
@@ -49,7 +49,7 @@ foreach ($path in $paths) {
$rand = [Guid]::NewGuid().Guid
$isAdmin = [bool]([Security.Principal.WindowsIdentity]::GetCurrent().Groups -match 'S-1-5-32-544')
-$FilePath = if ($isAdmin) { "$env:SystemRoot\Temp\MAS_$rand.cmd" } else { "$env:TEMP\MAS_$rand.cmd" }
+$FilePath = if ($isAdmin) { "$env:SystemRoot\Temp\MAS_$rand.cmd" } else { "$env:USERPROFILE\AppData\Local\Temp\MAS_$rand.cmd" }
$ScriptArgs = "$args "
$prefix = "@::: $rand `r`n"
@@ -60,5 +60,5 @@ Set-Content -Path $FilePath -Value $content
$env:ComSpec = "$env:SystemRoot\system32\cmd.exe"
Start-Process cmd.exe "/c """"$FilePath"" $ScriptArgs""" -Wait
-$FilePaths = @("$env:TEMP\MAS*.cmd", "$env:SystemRoot\Temp\MAS*.cmd")
+$FilePaths = @("$env:SystemRoot\Temp\MAS*.cmd", "$env:USERPROFILE\AppData\Local\Temp\MAS*.cmd")
foreach ($FilePath in $FilePaths) { Get-Item $FilePath | Remove-Item }