Skip to content

Instantly share code, notes, and snippets.

@awebre
Last active March 18, 2024 21:17
Show Gist options
  • Save awebre/ddb09cfe410e54985b38a5ca29f0612c to your computer and use it in GitHub Desktop.
Save awebre/ddb09cfe410e54985b38a5ca29f0612c to your computer and use it in GitHub Desktop.
DevBoxInstall.ps1
#Install New apps
$apps = @(
@{ Name = "LINQPad.LINQPad.8" },
@{ Name = "Oracle.MySQLWorkbench" },
@{ Name = "Chocolatey.Chocolatey" },
@{ Name = "Git.Git" },
@{ Name = "Cloudflare.cloudflared" },
@{ Name = "Insomnia.Insomnia" },
@{ Name = "Mozilla.Firefox" },
@{ Name = "ShareX.ShareX" },
@{ Name = "Gyan.FFmpeg" },
@{ Name = "ShiningLight.OpenSSL" },
@{ Name = "CoreyButler.NVMforWindows" },
@{ Name = "Yarn.Yarn" },
@{ Name = "Ngrok.Ngrok" },
@{ Name = "Microsoft.AzureDataStudio" },
@{ Name = "Microsoft.SQLServerManagementStudio" },
@{ Name = "Microsoft.VisualStudio.2022.Professional" },
@{ Name = "Microsoft.AzureCLI" },
@{ Name = "Microsoft.VisualStudioCode" },
@{ Name = "Microsoft.Azure.StorageExplorer" },
@{ Name = "Microsoft.PowerToys" },
@{ Name = "Fork.Fork" },
@{ Name = "Docker.DockerDesktop" },
@{ Name = "JetBrains.Toolbox" },
@{ Name = "Microsoft.DotNet.SDK.8" },
@{ Name = "JanDeDobbeleer.OhMyPosh" },
@{ Name = "Yubico.Authenticator" }
);
Write-Host "Checking for installed apps"
Foreach ($app in $apps) {
#check if the app is already installed
$listApp = winget list --exact -q $app.name
if (![String]::Join("", $listApp).Contains($app.name)) {
Write-host "Installing:" $app.name
if ($app.source -ne $null) {
winget install --exact --silent $app.name --source $app.source --accept-package-agreements
}
else {
winget install --exact --silent $app.name --accept-package-agreements
}
}
else {
Write-host "Skipping Install of " $app.name
}
}
#Install Dotnet Global Tools
$tools = @(
@{ Name = "dotnet-ef" }
)
Write-Host "Checking for global tools"
Foreach($tool in $tools) {
#check if the tool is already installed
dotnet tool list $tool.Name --global
if($LASTEXITCODE -eq 1)
{
dotnet tool install $tool.Name --global
} else {
Write-Host $tool.Name " already installed..."
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment