From a2dcc3e91d70256e9c1b0cfc882bab4001c9fa4c Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Thu, 11 Jan 2024 11:30:53 +0000 Subject: [PATCH] Drop elevation privileges in Windows --- roles/home-cli/files/Microsoft.PowerShell_profile.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles/home-cli/files/Microsoft.PowerShell_profile.ps1 b/roles/home-cli/files/Microsoft.PowerShell_profile.ps1 index 91a82ca..a298830 100644 --- a/roles/home-cli/files/Microsoft.PowerShell_profile.ps1 +++ b/roles/home-cli/files/Microsoft.PowerShell_profile.ps1 @@ -67,6 +67,9 @@ if ($IsWindows -or ($env:OS -eq "Windows_NT")) { function who { & "$env:SystemRoot\System32\query.exe" user } + + # Drop elevation privileges. + $env:__COMPAT_LAYER = "RunAsInvoker" } Set-PSReadlineOption -BellStyle None