Last active
October 17, 2025 02:55
-
-
Save joaohcrangel/ef7c83efaaca5846b691d215834d44bd to your computer and use it in GitHub Desktop.
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
| #Ask with a prompt for the user to enter the PC NAME | |
| $pcName = Read-Host "Enter the PC Name" | |
| 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 { | |
| $wslEnabled = (Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux).State -eq "Enabled" | |
| if (-not $wslEnabled) { | |
| Write-Output "Habilitando WSL..." | |
| Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart | |
| } | |
| } | |
| # 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 | |
| winget install --id DBeaver.DBeaver.Community -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 | |
| # 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 | |
| # Instalar WhatsApp | |
| winget install --id GitHub.cli -e --accept-package-agreements | |
| winget install --id Microsoft.PowerToys -e --accept-package-agreements | |
| winget install --id Hashicorp.Terraform -e --accept-package-agreements | |
| winget install --id Microsoft.AzureCLI -e --accept-package-agreements | |
| winget install --id Amazon.AWSCLI -e --accept-package-agreements | |
| winget install --id Hashicorp.Terraform -e --accept-package-agreements | |
| winget install --id Valve.Steam -e --accept-package-agreements | |
| winget install --id RARLab.WinRAR -e --accept-package-agreements | |
| winget install --id Kubernetes.kubectl -e --accept-package-agreements | |
| winget install --id Helm.Helm -e --accept-package-agreements | |
| winget install --id DigitalOcean.Doctl -e --accept-package-agreements | |
| 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 | |
| } | |
| ssh-keygen -t ed25519 -C "${$pcName}" -q -N "" -f "~/.ssh/id_ed25519" | |
| # Obter a chave publica e colocar em uma variavel | |
| $publicKey = Get-Content "~/.ssh/id_ed25519.pub" | |
| #Pegar a variavel com a chave publica a adiconar na minha conta do github com o gh | |
| gh auth login | |
| gh ssh-key add -k $publicKey -t ed25519 -l "${$pcName}" -y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment