Last active
October 9, 2024 17:36
-
-
Save joaohcrangel/ef7c83efaaca5846b691d215834d44bd to your computer and use it in GitHub Desktop.
This file contains 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
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned | |
Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe | |
# Função para habilitar o Winget se não estiver habilitado | |
function Enable-Winget { | |
if (-not (Get-Command winget -ErrorAction SilentlyContinue)) { | |
Write-Output "Winget não está instalado. Instalando..." | |
$progressPreference = 'silentlyContinue' | |
Write-Information "Downloading WinGet and its dependencies..." | |
Invoke-WebRequest -Uri https://aka.ms/getwinget -OutFile Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle | |
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx | |
Invoke-WebRequest -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx -OutFile Microsoft.UI.Xaml.2.8.x64.appx | |
Add-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appx | |
Add-AppxPackage Microsoft.UI.Xaml.2.8.x64.appx | |
Add-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle | |
} | |
} | |
# Função para habilitar o WSL se não estiver habilitado | |
function Enable-WSL { | |
# Verificar se o WSL está instalado | |
$wslFeature = Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux | |
if ($wslFeature.State -eq "Disabled") { | |
Write-Host "WSL não está instalado. Instalando o WSL..." | |
# Habilitar o WSL | |
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart | |
} else { | |
Write-Host "WSL já está instalado." | |
} | |
# Verificar se o WSL 2 está configurado como padrão | |
$wslVersion = wsl --list --verbose 2>&1 | Select-String "Default Version: 2" | |
if (-not $wslVersion) { | |
Write-Host "WSL 2 não está configurado como padrão. Configurando..." | |
# Habilitar o WSL 2 | |
wsl --set-default-version 2 | |
} else { | |
Write-Host "WSL 2 já está configurado como padrão." | |
} | |
# Instalar a distribuição Ubuntu | |
Write-Host "Instalação concluída. Reinicie o sistema para aplicar as alterações." | |
} | |
# Função para habilitar o Hyper-V se não estiver habilitado | |
function Enable-HyperV { | |
$hyperVEnabled = (Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All).State -eq "Enabled" | |
if (-not $hyperVEnabled) { | |
Write-Output "Habilitando Hyper-V..." | |
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All -NoRestart | |
} | |
} | |
# Habilitar Winget, WSL e Hyper-V | |
Enable-Winget | |
Enable-WSL | |
Enable-HyperV | |
# Instalar as atualizações pendentes e reiniciar, se necessário | |
if (Test-PendingReboot) { | |
Write-Output "Existem atualizações pendentes. Reiniciando o sistema..." | |
Restart-Computer | |
# Esperar até que o sistema esteja pronto após o reinício | |
Start-Sleep -Seconds 60 | |
} | |
# Instalar Google Chrome | |
winget install --id Google.Chrome -e --accept-package-agreements | |
# Instalar Git | |
winget install --id Git.Git -e --accept-package-agreements | |
# Instalar Docker | |
winget install --id Docker.DockerDesktop -e --accept-package-agreements --source winget | |
# Instalar MySQL Workbench | |
winget install --id Oracle.MySQLWorkbench -e --accept-package-agreements | |
# Instalar pgAdmin | |
winget install --id PostgreSQL.pgAdmin -e --accept-package-agreements | |
# Instalar Visual Studio Code com a opção de menu de contexto | |
winget install --id Microsoft.VisualStudioCode -e --accept-package-agreements --override '--add-context-menu=files --add-context-menu=folders' | |
# Instalar Figma Desktop | |
winget install --id Figma.Figma -e --accept-package-agreements | |
# Instalar Windows Terminal | |
winget install --id Microsoft.WindowsTerminal -e --accept-package-agreements | |
# Instalar PowerShell 7.4.3 | |
winget install --id Microsoft.Powershell --version 7.4.3 -e --accept-package-agreements | |
# Instalar WhatsApp Desktop | |
winget install --id WhatsApp.WhatsApp.Desktop -e --accept-package-agreements | |
# Instalar Postman | |
winget install --id Postman.Postman -e --accept-package-agreements | |
# Instalar OBS Studio | |
winget install --id OBSProject.OBSStudio -e --accept-package-agreements | |
# Instalar Node.js | |
winget install --id OpenJS.NodeJS -e --accept-package-agreements | |
# Instalar Python | |
winget install --id Python.Python.3 -e --accept-package-agreements | |
# Instalar Rust | |
winget install --id Rustlang.Rustup -e --accept-package-agreements | |
# Instalar Go Lang | |
winget install --id GoLang.Go -e --accept-package-agreements | |
# Instalar JW Library | |
winget install --id 9WZDNCRFJ3B4 -e --accept-package-agreements | |
# Instalar Kee Pass | |
winget install --id DominikReichl.KeePass -e --accept-package-agreements | |
# Instalar VsCode Insiders | |
winget install --id Microsoft.VisualStudioCode.Insiders -e --accept-package-agreements | |
# Instalar Android Studio | |
winget install --id Google.AndroidStudio -e --accept-package-agreements | |
# Instalar Visual Studio 2022 | |
winget install --id Microsoft.VisualStudio.2022.Community -e --accept-package-agreements | |
# Instalar Zoom | |
winget install --id Zoom.Zoom -e --accept-package-agreements | |
# Instalar Microsoft Teams | |
winget install --id Microsoft.Teams -e --accept-package-agreements | |
# Instalar WhatsApp | |
winget install --id 9NKSQGP7F2NH -e --accept-package-agreements | |
# Azure CLI | |
winget install -e --id Microsoft.AzureCLI --accept-package-agreements | |
# AWS CLI | |
winget install -e --id Amazon.AWSCLI --accept-package-agreements | |
# Terraform | |
winget install -e --id Hashicorp.Terraform --accept-package-agreements | |
# Helm | |
winget install -e --id Helm.Helm --accept-package-agreements | |
# PowerToys | |
winget install --id Microsoft.PowerToys --source winget | |
Write-Output "Todos os aplicativos foram instalados com sucesso." | |
# Função para verificar se há uma reinicialização pendente | |
function Test-PendingReboot { | |
$pending = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending" -ErrorAction SilentlyContinue | |
return $pending -ne $null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment