Last active
March 15, 2026 15:28
-
-
Save masmarius/362d71a5b1a320effbeb9f0ed2911cda to your computer and use it in GitHub Desktop.
install-scoop-base-admin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Test if Admin | |
| if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) | |
| { Write-Host "This script requires administrative privileges."; Exit } | |
| # Check if scoop is installed | |
| Function Test-ScoopInstalled { | |
| $scoopPath = "%USERPROFILE%\Scoop" | |
| return (Test-Path $scoopPath) | |
| } | |
| $initiallyInstalled = Test-ScoopInstalled | |
| # Install dependencies | |
| if (-NOT $initiallyInstalled) { | |
| Set-ExecutionPolicy RemoteSigned -scope CurrentUser | |
| Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1 | |
| reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1" | |
| } | |
| Pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment