Skip to content

Instantly share code, notes, and snippets.

@masmarius
Last active March 15, 2026 15:28
Show Gist options
  • Select an option

  • Save masmarius/362d71a5b1a320effbeb9f0ed2911cda to your computer and use it in GitHub Desktop.

Select an option

Save masmarius/362d71a5b1a320effbeb9f0ed2911cda to your computer and use it in GitHub Desktop.
install-scoop-base-admin
# 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