PowerShell¶
Permit PowerShell to run local scripts¶
“C:\Program Files\PowerShell\7\pwsh.exe” D:\Dropbox\Config\Startup.ps1
Make sure a script runs with full admin privileges¶
param([switch]$Elevated)
function Test-Admin {
    $currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
    $currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
if ((Test-Admin) -eq $false)  {
    if ($elevated) {
        # tried to elevate, did not work, aborting
    } else {
        Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -noexit -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition))
    }
    exit
}
## Running with full privileges
Run¶
control userpasswords2
Turn off Defender¶
- Search for gpedit.msc and click the top result to open the Local Group Policy Editor.
- Browse the following path:
Computer Configuration > Administrative Templates > Windows Components > Microsoft Defender Antivirus
Fix boot problem¶
Cập nhật lần cuối :
30 tháng 6, 2024
Tạo : 12 tháng 10, 2023
Tạo : 12 tháng 10, 2023