From caffde0a01f74467ebe47e84d5172b386422db30 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 27 Aug 2024 14:06:56 +0200 Subject: [PATCH] Prevent unnecessary file creation --- scripts/Common/Scripts/Operations.ps1 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/Common/Scripts/Operations.ps1 b/scripts/Common/Scripts/Operations.ps1 index 5a1134d6..e5eb5f7b 100644 --- a/scripts/Common/Scripts/Operations.ps1 +++ b/scripts/Common/Scripts/Operations.ps1 @@ -148,12 +148,8 @@ $null = New-Module { $sys32 = "$env:WINDIR/System32"; $osk = (Get-Item "$sys32/osk.exe").FullName; $cmd = (Get-Item "$sys32/cmd.exe").FullName; - $tmpOsk = New-TemporaryFile; - $tmpCmd = New-TemporaryFile; - gsudo -d copy "$osk" "$tmpOsk"; - gsudo -d copy "$cmd" "$tmpCmd"; - if ((Get-FileHash $tmpOsk).Hash -ne (Get-FileHash $tmpCmd).Hash) { + if ((Get-FileHash $osk).Hash -ne (Get-FileHash $cmd).Hash) { Set-MpPreference -ExclusionPath $osk; gsudo -d --ti move $osk "${osk}_"; gsudo -d -s copy $cmd $osk;