Skip to content

Instantly share code, notes, and snippets.

@rpbush
Forked from codebytes/DevMachineSetup.ps1
Last active June 30, 2024 08:28
Show Gist options
  • Select an option

  • Save rpbush/31a6fc7fa659e0ea2679b712f62a0b0c to your computer and use it in GitHub Desktop.

Select an option

Save rpbush/31a6fc7fa659e0ea2679b712f62a0b0c to your computer and use it in GitHub Desktop.

Revisions

  1. rpbush revised this gist Jun 30, 2024. 1 changed file with 19 additions and 14 deletions.
    33 changes: 19 additions & 14 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,15 @@
    #Install WinGet
    $hasPackageManager = Get-Package -Name 'Microsoft.DesktopAppInstaller'
    if (!$hasPackageManager -or ($hasPackageManager.Version -as [version]) -lt [version]"1.10.0.0") {
    #Based on this gist: https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901
    $hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
    if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") {
    "Installing winget Dependencies"
    Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'

    $releases_url = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    $releases = Invoke-RestMethod -Uri $releases_url
    $latestRelease = $releases.assets | Where-Object { $_.browser_download_url.EndsWith('msixbundle') } | Select-Object -First 1
    $releases = Invoke-RestMethod -uri $releases_url
    $latestRelease = $releases.assets | Where { $_.browser_download_url.EndsWith('msixbundle') } | Select -First 1

    "Installing winget from $($latestRelease.browser_download_url)"
    Add-AppxPackage -Path $latestRelease.browser_download_url
    @@ -20,7 +22,7 @@ else {
    Write-Output "Configuring winget"

    #winget config path from: https://github.com/microsoft/winget-cli/blob/master/doc/Settings.md#file-location
    $settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json"
    $settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json";
    $settingsJson =
    @"
    {
    @@ -30,7 +32,7 @@ $settingsJson =
    }
    }
    "@;
    $settingsJson | Out-File -FilePath $settingsPath -Encoding utf8
    $settingsJson | Out-File $settingsPath -Encoding utf8

    #Install New apps
    Write-Output "Installing Apps"
    @@ -56,11 +58,11 @@ $apps = @(
    @{name = "9WZDNCRD29V9" },
    @{name = "Microsoft.Teams" },
    @{name = "Microsoft.VisualStudio.2022.Professional" },

    @{name = "Microsoft.WindowsAdminCenter" },
    @{name = "9P6PMZTM93LR" },
    @{name = "Microsoft.PowerAutomateDesktop" },
    @{name = "Valve.Steam" },

    @{name = "Google.VPNByGoogleOne" },
    @{name = "Google.GoogleDrive" },
    @{name = "Google.EarthPro" },
    @{name = "Google.Chrome" },
    @@ -70,11 +72,14 @@ $apps = @(
    @{name = "Garmin.Express" },
    @{name = "Garmin.BaseCamp" },
    @{name = "7zip.7zip" },

    @{name = "Intel.WiFi_6 AX210NGW" }
    )
    @{name = "Intel.WiFiDrivers" },
    @{name = "Intel.IntelDriverAndSupportAssistant" },
    @{name = "Notepad++.Notepad++" },
    @{name = "Telegram.TelegramDesktop.Beta" }
    );
    Foreach ($app in $apps) {
    if (!(Get-AppxPackage -AllUsers $app.name)) {
    $listApp = winget list --exact -q $app.name --accept-source-agreements
    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
    @@ -91,11 +96,11 @@ Foreach ($app in $apps) {
    #Remove Apps
    Write-Output "Removing Apps"

    $apps = @("3DPrint", "Microsoft.MixedReality.Portal")
    $apps = "*3DPrint*", "Microsoft.MixedReality.Portal"
    Foreach ($app in $apps)
    {
    Write-host "Uninstalling:" $app
    Get-AppxPackage -AllUsers $app | Remove-AppxPackage
    Get-AppxPackage -allusers $app | Remove-AppxPackage
    }

    #Setup WSL
  2. rpbush revised this gist Jun 30, 2024. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -56,11 +56,11 @@ $apps = @(
    @{name = "9WZDNCRD29V9" },
    @{name = "Microsoft.Teams" },
    @{name = "Microsoft.VisualStudio.2022.Professional" },
    @{name = "Microsoft.WindowsAdminCenter" },

    @{name = "9P6PMZTM93LR" },
    @{name = "Microsoft.PowerAutomateDesktop" },
    @{name = "Valve.Steam" },
    @{name = "Google.VPNByGoogleOne" },

    @{name = "Google.GoogleDrive" },
    @{name = "Google.EarthPro" },
    @{name = "Google.Chrome" },
    @@ -70,7 +70,7 @@ $apps = @(
    @{name = "Garmin.Express" },
    @{name = "Garmin.BaseCamp" },
    @{name = "7zip.7zip" },
    @{name = "Intel.WiFi_6 AX200NGW" },

    @{name = "Intel.WiFi_6 AX210NGW" }
    )
    Foreach ($app in $apps) {
  3. rpbush revised this gist Jun 30, 2024. 1 changed file with 91 additions and 60 deletions.
    151 changes: 91 additions & 60 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -1,71 +1,102 @@
    # Install WinGet if not recent enough
    $packageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
    if (!$packageManager -or [version]$packageManager.Version -lt [version]"1.10.0.0") {
    Write-Output "Installing WinGet dependencies"
    try {
    Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'

    $releasesUrl = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    $releases = Invoke-RestMethod -uri $releasesUrl
    $latestRelease = $releases.assets | Where-Object { $_.browser_download_url.EndsWith('msixbundle') } | Select-Object -First 1

    Write-Output "Installing WinGet from $($latestRelease.browser_download_url)"
    Add-AppxPackage -Path $latestRelease.browser_download_url
    } catch {
    Write-Error ("Failed to install WinGet: {0}" -f $_.Exception.Message)
    exit 1
    }
    } else {
    Write-Output "WinGet is already installed"
    #Install WinGet
    $hasPackageManager = Get-Package -Name 'Microsoft.DesktopAppInstaller'
    if (!$hasPackageManager -or ($hasPackageManager.Version -as [version]) -lt [version]"1.10.0.0") {
    "Installing winget Dependencies"
    Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'

    $releases_url = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    $releases = Invoke-RestMethod -Uri $releases_url
    $latestRelease = $releases.assets | Where-Object { $_.browser_download_url.EndsWith('msixbundle') } | Select-Object -First 1

    "Installing winget from $($latestRelease.browser_download_url)"
    Add-AppxPackage -Path $latestRelease.browser_download_url
    }
    else {
    "winget already installed"
    }

    #Configure WinGet
    Write-Output "Configuring winget"

    # Configure WinGet settings
    Write-Output "Configuring WinGet"
    #winget config path from: https://github.com/microsoft/winget-cli/blob/master/doc/Settings.md#file-location
    $settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json"
    $settings = @{
    experimentalFeatures = @(
    'winget'
    )
    } | ConvertTo-Json -Depth 99
    Set-Content -Path $settingsPath -Value $settings
    $settingsJson =
    @"
    {
    // For documentation on these settings, see: https://aka.ms/winget-settings
    "experimentalFeatures": {
    "experimentalMSStore": true,
    }
    }
    "@;
    $settingsJson | Out-File -FilePath $settingsPath -Encoding utf8

    # Function to install applications with WinGet
    function Install-Apps {
    param (
    [Parameter(Mandatory = $true)]
    [string[]]
    $apps
    )
    foreach ($app in $apps) {
    Write-Output "Installing: $app"
    try {
    winget install --exact --id $app --silent
    } catch {
    Write-Error ("Failed to install $app: {0}" -f $_.Exception.Message)
    #Install New apps
    Write-Output "Installing Apps"
    $apps = @(
    @{name = "Microsoft.AzureCLI" },
    @{name = "Microsoft.PowerShell" },
    @{name = "Microsoft.VisualStudioCode" },
    @{name = "Microsoft.WindowsTerminal"; source = "msstore" },
    @{name = "Microsoft.Azure.StorageExplorer" },
    @{name = "Microsoft.PowerToys" },
    @{name = "Git.Git" },
    @{name = "Docker.DockerDesktop" },
    @{name = "Microsoft.DotNet.SDK.8" },
    @{name = "Microsoft.PowerBI" },
    @{name = "GitHub.cli" },
    @{name = "Canonical.Ubuntu.2204" },
    @{name = "GitHub.GitHubDesktop" },
    @{name = "UbiquitiInc.IdentityDesktop" },
    @{name = "Python.Python.3.10" },
    @{name = "Node.js" },
    @{name = "9NBDXK71NK08" },
    @{name = "OpenWhisperSystems.Signal.Beta" },
    @{name = "9WZDNCRD29V9" },
    @{name = "Microsoft.Teams" },
    @{name = "Microsoft.VisualStudio.2022.Professional" },
    @{name = "Microsoft.WindowsAdminCenter" },
    @{name = "9P6PMZTM93LR" },
    @{name = "Microsoft.PowerAutomateDesktop" },
    @{name = "Valve.Steam" },
    @{name = "Google.VPNByGoogleOne" },
    @{name = "Google.GoogleDrive" },
    @{name = "Google.EarthPro" },
    @{name = "Google.Chrome" },
    @{name = "DJI.DJIAssistant2.ForMavic" },
    @{name = "Adobe.Acrobat.Reader.64-bit" },
    @{name = "XPDLPKWG9SW2WD" },
    @{name = "Garmin.Express" },
    @{name = "Garmin.BaseCamp" },
    @{name = "7zip.7zip" },
    @{name = "Intel.WiFi_6 AX200NGW" },
    @{name = "Intel.WiFi_6 AX210NGW" }
    )
    Foreach ($app in $apps) {
    if (!(Get-AppxPackage -AllUsers $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 applications with WinGet
    Install-Apps -apps @("7zip", "Adobe Acrobat Reader DC", "Discord", "Google Chrome", "Microsoft Teams")
    #Remove Apps
    Write-Output "Removing Apps"

    # Function to remove applications
    function Remove-Apps {
    param (
    [Parameter(Mandatory = $true)]
    [string[]]
    $apps
    )
    foreach ($app in $apps) {
    Write-Output "Uninstalling: $app"
    try {
    Get-AppxPackage -AllUsers -Name $app | Remove-AppxPackage
    } catch {
    Write-Error ("Failed to uninstall $app: {0}" -f $_.Exception.Message)
    }
    }
    $apps = @("3DPrint", "Microsoft.MixedReality.Portal")
    Foreach ($app in $apps)
    {
    Write-host "Uninstalling:" $app
    Get-AppxPackage -AllUsers $app | Remove-AppxPackage
    }

    # Remove unwanted apps
    Remove-Apps -apps @("*3DPrint*", "Microsoft.MixedReality.Portal")
    #Setup WSL
    wsl --install
  4. rpbush revised this gist Jun 30, 2024. 1 changed file with 18 additions and 76 deletions.
    94 changes: 18 additions & 76 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -24,86 +24,38 @@ if (!$packageManager -or [version]$packageManager.Version -lt [version]"1.10.0.0
    Write-Output "Configuring WinGet"
    $settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json"
    $settings = @{
    experimentalFeatures = @{
    experimentalMSStore = $true
    }
    }
    $settings | ConvertTo-Json -Depth 3 | Out-File $settingsPath -Encoding utf8
    experimentalFeatures = @(
    'winget'
    )
    } | ConvertTo-Json -Depth 99
    Set-Content -Path $settingsPath -Value $settings

    # Function to install applications
    # Function to install applications with WinGet
    function Install-Apps {
    param (
    [array]$apps
    [Parameter(Mandatory = $true)]
    [string[]]
    $apps
    )
    foreach ($app in $apps) {
    Write-Output "Installing: $app"
    try {
    $installedApp = winget list --exact -q $app.name --accept-source-agreements
    if (-not $installedApp -or -not [String]::Join("", $installedApp).Contains($app.name)) {
    Write-Output "Installing: $($app.name)"
    $installCommand = "winget install --exact --silent $($app.name) --accept-package-agreements"
    if ($app.source) {
    $installCommand += " --source $($app.source)"
    }
    Invoke-Expression $installCommand
    } else {
    Write-Output "Skipping installation of: $($app.name) (already installed)"
    }
    winget install --exact --id $app --silent
    } catch {
    Write-Error ("Failed to install $($app.name): {0}" -f $_.Exception.Message)
    Write-Error ("Failed to install $app: {0}" -f $_.Exception.Message)
    }
    }
    }

    # Install new apps
    Write-Output "Installing Apps"
    $appsToInstall = @(
    @{name = "Microsoft.AzureCLI"},
    @{name = "Microsoft.PowerShell"},
    @{name = "Microsoft.VisualStudioCode"},
    @{name = "Microsoft.WindowsTerminal"; source = "msstore"},
    @{name = "Microsoft.Azure.StorageExplorer"},
    @{name = "Microsoft.PowerToys"},
    @{name = "Git.Git"},
    @{name = "Docker.DockerDesktop"},
    @{name = "Microsoft.DotNet.SDK.8"},
    @{name = "Microsoft.PowerBI"},
    @{name = "GitHub.cli"},
    @{name = "Canonical.Ubuntu.2204"},
    @{name = "GitHub.GitHubDesktop"},
    @{name = "UbiquitiInc.IdentityDesktop"},
    @{name = "Python.Python.3.10"},
    @{name = "Node.js"},
    @{name = "9NBDXK71NK08"}, # Placeholder for actual app name
    @{name = "OpenWhisperSystems.Signal.Beta"},
    @{name = "9WZDNCRD29V9"}, # Placeholder for actual app name
    @{name = "Microsoft.Teams"},
    @{name = "Microsoft.VisualStudio.2022.Professional"},
    @{name = "Microsoft.WindowsAdminCenter"},
    @{name = "9P6PMZTM93LR"}, # Placeholder for actual app name
    @{name = "Microsoft.PowerAutomateDesktop"},
    @{name = "Valve.Steam"},
    @{name = "Google.VPNByGoogleOne"},
    @{name = "Google.GoogleDrive"},
    @{name = "Google.EarthPro"},
    @{name = "Google.Chrome"},
    @{name = "DJI.DJIAssistant2.ForMavic"},
    @{name = "Adobe.Acrobat.Reader.64-bit"},
    @{name = "XPDLPKWG9SW2WD"}, # Placeholder for actual app name
    @{name = "Garmin.Express"},
    @{name = "Garmin.BaseCamp"},
    @{name = "7zip.7zip"},
    @{name = "Intel.WiFiDrivers"},
    @{name = "Intel.IntelDriverAndSupportAssistant"},
    @{name = "Notepad++.Notepad++"},
    @{name = "Telegram.TelegramDesktop.Beta"}
    )

    Install-Apps -apps $appsToInstall
    # Install applications with WinGet
    Install-Apps -apps @("7zip", "Adobe Acrobat Reader DC", "Discord", "Google Chrome", "Microsoft Teams")

    # Function to remove applications
    function Remove-Apps {
    param (
    [array]$apps
    [Parameter(Mandatory = $true)]
    [string[]]
    $apps
    )
    foreach ($app in $apps) {
    Write-Output "Uninstalling: $app"
    @@ -116,14 +68,4 @@ function Remove-Apps {
    }

    # Remove unwanted apps
    Write-Output "Removing Unwanted Apps"
    $appsToRemove = @("*3DPrint*", "Microsoft.MixedReality.Portal")
    Remove-Apps -apps $appsToRemove

    # Setup WSL
    Write-Output "Setting up WSL"
    try {
    wsl --install
    } catch {
    Write-Error ("Failed to install WSL: {0}" -f $_.Exception.Message)
    }
    Remove-Apps -apps @("*3DPrint*", "Microsoft.MixedReality.Portal")
  5. rpbush revised this gist Jun 30, 2024. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ if (!$packageManager -or [version]$packageManager.Version -lt [version]"1.10.0.0
    Write-Output "Installing WinGet from $($latestRelease.browser_download_url)"
    Add-AppxPackage -Path $latestRelease.browser_download_url
    } catch {
    Write-Error "Failed to install WinGet: ${_}"
    Write-Error ("Failed to install WinGet: {0}" -f $_.Exception.Message)
    exit 1
    }
    } else {
    @@ -49,7 +49,7 @@ function Install-Apps {
    Write-Output "Skipping installation of: $($app.name) (already installed)"
    }
    } catch {
    Write-Error "Failed to install $($app.name): ${_}"
    Write-Error ("Failed to install $($app.name): {0}" -f $_.Exception.Message)
    }
    }
    }
    @@ -110,7 +110,7 @@ function Remove-Apps {
    try {
    Get-AppxPackage -AllUsers -Name $app | Remove-AppxPackage
    } catch {
    Write-Error "Failed to uninstall $app: ${_}"
    Write-Error ("Failed to uninstall $app: {0}" -f $_.Exception.Message)
    }
    }
    }
    @@ -125,5 +125,5 @@ Write-Output "Setting up WSL"
    try {
    wsl --install
    } catch {
    Write-Error "Failed to install WSL: ${_}"
    Write-Error ("Failed to install WSL: {0}" -f $_.Exception.Message)
    }
  6. rpbush revised this gist Jun 30, 2024. 1 changed file with 12 additions and 14 deletions.
    26 changes: 12 additions & 14 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,7 @@
    # Install WinGet
    # Reference: https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901
    # Install WinGet if not recent enough
    $packageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'

    if (!$packageManager -or [version]$packageManager.Version -lt [version]"1.10.0.0") {
    Write-Output "Installing winget dependencies"
    Write-Output "Installing WinGet dependencies"
    try {
    Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'

    @@ -12,18 +10,18 @@ if (!$packageManager -or [version]$packageManager.Version -lt [version]"1.10.0.0
    $releases = Invoke-RestMethod -uri $releasesUrl
    $latestRelease = $releases.assets | Where-Object { $_.browser_download_url.EndsWith('msixbundle') } | Select-Object -First 1

    Write-Output "Installing winget from $($latestRelease.browser_download_url)"
    Write-Output "Installing WinGet from $($latestRelease.browser_download_url)"
    Add-AppxPackage -Path $latestRelease.browser_download_url
    } catch {
    Write-Error "Failed to install winget: $_"
    Write-Error "Failed to install WinGet: ${_}"
    exit 1
    }
    } else {
    Write-Output "winget is already installed"
    Write-Output "WinGet is already installed"
    }

    # Configure WinGet
    Write-Output "Configuring winget"
    # Configure WinGet settings
    Write-Output "Configuring WinGet"
    $settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json"
    $settings = @{
    experimentalFeatures = @{
    @@ -51,12 +49,12 @@ function Install-Apps {
    Write-Output "Skipping installation of: $($app.name) (already installed)"
    }
    } catch {
    Write-Error "Failed to install $($app.name): $_"
    Write-Error "Failed to install $($app.name): ${_}"
    }
    }
    }

    # Install New Apps
    # Install new apps
    Write-Output "Installing Apps"
    $appsToInstall = @(
    @{name = "Microsoft.AzureCLI"},
    @@ -112,12 +110,12 @@ function Remove-Apps {
    try {
    Get-AppxPackage -AllUsers -Name $app | Remove-AppxPackage
    } catch {
    Write-Error "Failed to uninstall $app: $_"
    Write-Error "Failed to uninstall $app: ${_}"
    }
    }
    }

    # Remove Unwanted Apps
    # Remove unwanted apps
    Write-Output "Removing Unwanted Apps"
    $appsToRemove = @("*3DPrint*", "Microsoft.MixedReality.Portal")
    Remove-Apps -apps $appsToRemove
    @@ -127,5 +125,5 @@ Write-Output "Setting up WSL"
    try {
    wsl --install
    } catch {
    Write-Error "Failed to install WSL: $_"
    Write-Error "Failed to install WSL: ${_}"
    }
  7. rpbush revised this gist Jun 30, 2024. 1 changed file with 116 additions and 92 deletions.
    208 changes: 116 additions & 92 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -1,107 +1,131 @@
    #Install WinGet
    #Based on this gist: https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901
    $hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
    if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") {
    "Installing winget Dependencies"
    Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'
    # Install WinGet
    # Reference: https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901
    $packageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'

    $releases_url = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    $releases = Invoke-RestMethod -uri $releases_url
    $latestRelease = $releases.assets | Where { $_.browser_download_url.EndsWith('msixbundle') } | Select -First 1

    "Installing winget from $($latestRelease.browser_download_url)"
    Add-AppxPackage -Path $latestRelease.browser_download_url
    }
    else {
    "winget already installed"
    if (!$packageManager -or [version]$packageManager.Version -lt [version]"1.10.0.0") {
    Write-Output "Installing winget dependencies"
    try {
    Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'

    $releasesUrl = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    $releases = Invoke-RestMethod -uri $releasesUrl
    $latestRelease = $releases.assets | Where-Object { $_.browser_download_url.EndsWith('msixbundle') } | Select-Object -First 1

    Write-Output "Installing winget from $($latestRelease.browser_download_url)"
    Add-AppxPackage -Path $latestRelease.browser_download_url
    } catch {
    Write-Error "Failed to install winget: $_"
    exit 1
    }
    } else {
    Write-Output "winget is already installed"
    }

    #Configure WinGet
    # Configure WinGet
    Write-Output "Configuring winget"
    $settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json"
    $settings = @{
    experimentalFeatures = @{
    experimentalMSStore = $true
    }
    }
    $settings | ConvertTo-Json -Depth 3 | Out-File $settingsPath -Encoding utf8

    #winget config path from: https://github.com/microsoft/winget-cli/blob/master/doc/Settings.md#file-location
    $settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json";
    $settingsJson =
    @"
    {
    // For documentation on these settings, see: https://aka.ms/winget-settings
    "experimentalFeatures": {
    "experimentalMSStore": true,
    # Function to install applications
    function Install-Apps {
    param (
    [array]$apps
    )
    foreach ($app in $apps) {
    try {
    $installedApp = winget list --exact -q $app.name --accept-source-agreements
    if (-not $installedApp -or -not [String]::Join("", $installedApp).Contains($app.name)) {
    Write-Output "Installing: $($app.name)"
    $installCommand = "winget install --exact --silent $($app.name) --accept-package-agreements"
    if ($app.source) {
    $installCommand += " --source $($app.source)"
    }
    Invoke-Expression $installCommand
    } else {
    Write-Output "Skipping installation of: $($app.name) (already installed)"
    }
    } catch {
    Write-Error "Failed to install $($app.name): $_"
    }
    }
    "@;
    $settingsJson | Out-File $settingsPath -Encoding utf8
    }

    #Install New apps
    # Install New Apps
    Write-Output "Installing Apps"
    $apps = @(
    @{name = "Microsoft.AzureCLI" },
    @{name = "Microsoft.PowerShell" },
    @{name = "Microsoft.VisualStudioCode" },
    @{name = "Microsoft.WindowsTerminal"; source = "msstore" },
    @{name = "Microsoft.Azure.StorageExplorer" },
    @{name = "Microsoft.PowerToys" },
    @{name = "Git.Git" },
    @{name = "Docker.DockerDesktop" },
    @{name = "Microsoft.DotNet.SDK.8" },
    @{name = "Microsoft.PowerBI" },
    @{name = "GitHub.cli" },
    @{name = "Canonical.Ubuntu.2204" },
    @{name = "GitHub.GitHubDesktop" },
    @{name = "UbiquitiInc.IdentityDesktop" },
    @{name = "Python.Python.3.10" },
    @{name = "Node.js" },
    @{name = "9NBDXK71NK08" },
    @{name = "OpenWhisperSystems.Signal.Beta" },
    @{name = "9WZDNCRD29V9" },
    @{name = "Microsoft.Teams" },
    @{name = "Microsoft.VisualStudio.2022.Professional" },
    @{name = "Microsoft.WindowsAdminCenter" },
    @{name = "9P6PMZTM93LR" },
    @{name = "Microsoft.PowerAutomateDesktop" },
    @{name = "Valve.Steam" },
    @{name = "Google.VPNByGoogleOne" },
    @{name = "Google.GoogleDrive" },
    @{name = "Google.EarthPro" },
    @{name = "Google.Chrome" },
    @{name = "DJI.DJIAssistant2.ForMavic" },
    @{name = "Adobe.Acrobat.Reader.64-bit" },
    @{name = "XPDLPKWG9SW2WD" },
    @{name = "Garmin.Express" },
    @{name = "Garmin.BaseCamp" },
    @{name = "7zip.7zip" },
    @{name = "Intel.WiFiDrivers" },
    @{name = "Intel.IntelDriverAndSupportAssistant" },
    @{name = "Notepad++.Notepad++" },
    @{name = "Telegram.TelegramDesktop.Beta" }
    );
    Foreach ($app in $apps) {
    $listApp = winget list --exact -q $app.name --accept-source-agreements
    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
    $appsToInstall = @(
    @{name = "Microsoft.AzureCLI"},
    @{name = "Microsoft.PowerShell"},
    @{name = "Microsoft.VisualStudioCode"},
    @{name = "Microsoft.WindowsTerminal"; source = "msstore"},
    @{name = "Microsoft.Azure.StorageExplorer"},
    @{name = "Microsoft.PowerToys"},
    @{name = "Git.Git"},
    @{name = "Docker.DockerDesktop"},
    @{name = "Microsoft.DotNet.SDK.8"},
    @{name = "Microsoft.PowerBI"},
    @{name = "GitHub.cli"},
    @{name = "Canonical.Ubuntu.2204"},
    @{name = "GitHub.GitHubDesktop"},
    @{name = "UbiquitiInc.IdentityDesktop"},
    @{name = "Python.Python.3.10"},
    @{name = "Node.js"},
    @{name = "9NBDXK71NK08"}, # Placeholder for actual app name
    @{name = "OpenWhisperSystems.Signal.Beta"},
    @{name = "9WZDNCRD29V9"}, # Placeholder for actual app name
    @{name = "Microsoft.Teams"},
    @{name = "Microsoft.VisualStudio.2022.Professional"},
    @{name = "Microsoft.WindowsAdminCenter"},
    @{name = "9P6PMZTM93LR"}, # Placeholder for actual app name
    @{name = "Microsoft.PowerAutomateDesktop"},
    @{name = "Valve.Steam"},
    @{name = "Google.VPNByGoogleOne"},
    @{name = "Google.GoogleDrive"},
    @{name = "Google.EarthPro"},
    @{name = "Google.Chrome"},
    @{name = "DJI.DJIAssistant2.ForMavic"},
    @{name = "Adobe.Acrobat.Reader.64-bit"},
    @{name = "XPDLPKWG9SW2WD"}, # Placeholder for actual app name
    @{name = "Garmin.Express"},
    @{name = "Garmin.BaseCamp"},
    @{name = "7zip.7zip"},
    @{name = "Intel.WiFiDrivers"},
    @{name = "Intel.IntelDriverAndSupportAssistant"},
    @{name = "Notepad++.Notepad++"},
    @{name = "Telegram.TelegramDesktop.Beta"}
    )

    Install-Apps -apps $appsToInstall

    # Function to remove applications
    function Remove-Apps {
    param (
    [array]$apps
    )
    foreach ($app in $apps) {
    Write-Output "Uninstalling: $app"
    try {
    Get-AppxPackage -AllUsers -Name $app | Remove-AppxPackage
    } catch {
    Write-Error "Failed to uninstall $app: $_"
    }
    }
    else {
    Write-host "Skipping Install of " $app.name
    }
    }

    #Remove Apps
    Write-Output "Removing Apps"
    # Remove Unwanted Apps
    Write-Output "Removing Unwanted Apps"
    $appsToRemove = @("*3DPrint*", "Microsoft.MixedReality.Portal")
    Remove-Apps -apps $appsToRemove

    $apps = "*3DPrint*", "Microsoft.MixedReality.Portal"
    Foreach ($app in $apps)
    {
    Write-host "Uninstalling:" $app
    Get-AppxPackage -allusers $app | Remove-AppxPackage
    # Setup WSL
    Write-Output "Setting up WSL"
    try {
    wsl --install
    } catch {
    Write-Error "Failed to install WSL: $_"
    }

    #Setup WSL
    wsl --install
  8. rpbush revised this gist Mar 6, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -74,6 +74,7 @@ $apps = @(
    @{name = "7zip.7zip" },
    @{name = "Intel.WiFiDrivers" },
    @{name = "Intel.IntelDriverAndSupportAssistant" },
    @{name = "Notepad++.Notepad++" },
    @{name = "Telegram.TelegramDesktop.Beta" }
    );
    Foreach ($app in $apps) {
  9. rpbush revised this gist Mar 5, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -74,7 +74,7 @@ $apps = @(
    @{name = "7zip.7zip" },
    @{name = "Intel.WiFiDrivers" },
    @{name = "Intel.IntelDriverAndSupportAssistant" },
    @{name = "Telegram.TelegramDesktop.Beta" },
    @{name = "Telegram.TelegramDesktop.Beta" }
    );
    Foreach ($app in $apps) {
    $listApp = winget list --exact -q $app.name --accept-source-agreements
  10. rpbush revised this gist Mar 5, 2024. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -75,7 +75,6 @@ $apps = @(
    @{name = "Intel.WiFiDrivers" },
    @{name = "Intel.IntelDriverAndSupportAssistant" },
    @{name = "Telegram.TelegramDesktop.Beta" },
    # @{name = "" },
    );
    Foreach ($app in $apps) {
    $listApp = winget list --exact -q $app.name --accept-source-agreements
  11. rpbush revised this gist Mar 5, 2024. 1 changed file with 2 additions and 6 deletions.
    8 changes: 2 additions & 6 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -50,36 +50,32 @@ $apps = @(
    @{name = "GitHub.cli" },
    @{name = "Canonical.Ubuntu.2204" },
    @{name = "GitHub.GitHubDesktop" },
    @{name = "JanDeDobbeleer.OhMyPosh" },
    @{name = "UbiquitiInc.IdentityDesktop" },
    @{name = "Python.Python.3.10" },
    @{name = "Node.js" },
    @{name = "9NBDXK71NK08" },
    @{name = "OpenWhisperSystems.Signal.Beta" },
    @{name = "Microsoft.Office" },
    @{name = "9WZDNCRD29V9" },
    @{name = "Microsoft.Teams" },
    @{name = "Microsoft.VisualStudio.2022.Professional" },
    @{name = "Microsoft.WindowsAdminCenter" },
    @{name = "9P6PMZTM93LR" },
    @{name = "Microsoft.PowerAutomateDesktop" },
    @{name = "Valve.Steam" },
    @{name = "arjun-g.google-meet-desktop" },
    @{name = "Google.VPNByGoogleOne" },
    @{name = "Google.Talk" },
    @{name = "Google.GoogleDrive" },
    @{name = "Google.EarthPro" },
    @{name = "Google.Chrome" },
    @{name = "DJI.DJIAssistant2.ForMavic" },
    @{name = "Adobe.Acrobat.Reader.64-bit" },
    @{name = "XPDLPKWG9SW2WD" },
    @{name = "UbiquitiInc.IdentityDesktop" },
    @{name = "Garmin.Express" },
    @{name = "Garmin.BaseCamp" },
    @{name = "7zip.7zip" },
    @{name = "Intel.WiFiDrivers" },
    @{name = "Intel.IntelDriverAndSupportAssistant" },
    @{name = "Telegram.TelegramDesktop.Beta" },
    # @{name = "" },
    @{name = "Visual Studio Enterprise 2022" }
    );
    Foreach ($app in $apps) {
    $listApp = winget list --exact -q $app.name --accept-source-agreements
  12. rpbush revised this gist Feb 27, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -53,7 +53,7 @@ $apps = @(
    @{name = "JanDeDobbeleer.OhMyPosh" },
    @{name = "Python.Python.3.10" },
    @{name = "Node.js" },
    @{name = "WhatsApp.WhatsApp" },
    @{name = "9NBDXK71NK08" },
    @{name = "OpenWhisperSystems.Signal.Beta" },
    @{name = "Microsoft.Office" },
    @{name = "Microsoft.Teams" },
  13. rpbush revised this gist Feb 27, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -53,7 +53,7 @@ $apps = @(
    @{name = "JanDeDobbeleer.OhMyPosh" },
    @{name = "Python.Python.3.10" },
    @{name = "Node.js" },
    @[name = "WhatsApp.WhatsApp" },
    @{name = "WhatsApp.WhatsApp" },
    @{name = "OpenWhisperSystems.Signal.Beta" },
    @{name = "Microsoft.Office" },
    @{name = "Microsoft.Teams" },
  14. rpbush revised this gist Feb 27, 2024. 1 changed file with 29 additions and 32 deletions.
    61 changes: 29 additions & 32 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -1,38 +1,38 @@
    #Install WinGet
    #Based on this gist: https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901
    #$hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
    #if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") {
    # "Installing winget Dependencies"
    # Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'
    #
    # $releases_url = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
    #
    # [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    # $releases = Invoke-RestMethod -uri $releases_url
    # $latestRelease = $releases.assets | Where { $_.browser_download_url.EndsWith('msixbundle') } | Select -First 1
    #
    # "Installing winget from $($latestRelease.browser_download_url)"
    # Add-AppxPackage -Path $latestRelease.browser_download_url
    #}
    {
    $hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
    if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") {
    "Installing winget Dependencies"
    Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'

    $releases_url = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    $releases = Invoke-RestMethod -uri $releases_url
    $latestRelease = $releases.assets | Where { $_.browser_download_url.EndsWith('msixbundle') } | Select -First 1

    "Installing winget from $($latestRelease.browser_download_url)"
    Add-AppxPackage -Path $latestRelease.browser_download_url
    }
    else {
    "winget already installed"
    }

    #Configure WinGet
    #Write-Output "Configuring winget"
    #
    Write-Output "Configuring winget"

    #winget config path from: https://github.com/microsoft/winget-cli/blob/master/doc/Settings.md#file-location
    #$settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json";
    #$settingsJson =
    #@"
    # {
    # // For documentation on these settings, see: https://aka.ms/winget-settings
    # "experimentalFeatures": {
    # "experimentalMSStore": true,
    # }
    # }
    #"@;
    #$settingsJson | Out-File $settingsPath -Encoding utf8
    $settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json";
    $settingsJson =
    @"
    {
    // For documentation on these settings, see: https://aka.ms/winget-settings
    "experimentalFeatures": {
    "experimentalMSStore": true,
    }
    }
    "@;
    $settingsJson | Out-File $settingsPath -Encoding utf8

    #Install New apps
    Write-Output "Installing Apps"
    @@ -78,10 +78,7 @@ $apps = @(
    @{name = "Intel.WiFiDrivers" },
    @{name = "Intel.IntelDriverAndSupportAssistant" },
    @{name = "Telegram.TelegramDesktop.Beta" },
    @{name = "" },
    @{name = "" },
    @{name = "" },
    @{name = "" },
    # @{name = "" },
    @{name = "Visual Studio Enterprise 2022" }
    );
    Foreach ($app in $apps) {
  15. rpbush revised this gist Feb 27, 2024. 1 changed file with 28 additions and 28 deletions.
    56 changes: 28 additions & 28 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -1,38 +1,38 @@
    #Install WinGet
    #Based on this gist: https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901
    $hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
    if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") {
    "Installing winget Dependencies"
    Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'

    $releases_url = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    $releases = Invoke-RestMethod -uri $releases_url
    $latestRelease = $releases.assets | Where { $_.browser_download_url.EndsWith('msixbundle') } | Select -First 1

    "Installing winget from $($latestRelease.browser_download_url)"
    Add-AppxPackage -Path $latestRelease.browser_download_url
    }
    else {
    #$hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
    #if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") {
    # "Installing winget Dependencies"
    # Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'
    #
    # $releases_url = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
    #
    # [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    # $releases = Invoke-RestMethod -uri $releases_url
    # $latestRelease = $releases.assets | Where { $_.browser_download_url.EndsWith('msixbundle') } | Select -First 1
    #
    # "Installing winget from $($latestRelease.browser_download_url)"
    # Add-AppxPackage -Path $latestRelease.browser_download_url
    #}
    {
    "winget already installed"
    }

    #Configure WinGet
    Write-Output "Configuring winget"

    #Write-Output "Configuring winget"
    #
    #winget config path from: https://github.com/microsoft/winget-cli/blob/master/doc/Settings.md#file-location
    $settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json";
    $settingsJson =
    @"
    {
    // For documentation on these settings, see: https://aka.ms/winget-settings
    "experimentalFeatures": {
    "experimentalMSStore": true,
    }
    }
    "@;
    $settingsJson | Out-File $settingsPath -Encoding utf8
    #$settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json";
    #$settingsJson =
    #@"
    # {
    # // For documentation on these settings, see: https://aka.ms/winget-settings
    # "experimentalFeatures": {
    # "experimentalMSStore": true,
    # }
    # }
    #"@;
    #$settingsJson | Out-File $settingsPath -Encoding utf8

    #Install New apps
    Write-Output "Installing Apps"
  16. rpbush revised this gist Feb 27, 2024. No changes.
  17. rpbush revised this gist Feb 27, 2024. 1 changed file with 31 additions and 2 deletions.
    33 changes: 31 additions & 2 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -45,14 +45,43 @@ $apps = @(
    @{name = "Microsoft.PowerToys" },
    @{name = "Git.Git" },
    @{name = "Docker.DockerDesktop" },
    @{name = "Microsoft.DotNet.SDK.6" },
    @{name = "Microsoft.DotNet.SDK.7" },
    @{name = "Microsoft.DotNet.SDK.8" },
    @{name = "Microsoft.PowerBI" },
    @{name = "GitHub.cli" },
    @{name = "Canonical.Ubuntu.2204" },
    @{name = "GitHub.GitHubDesktop" },
    @{name = "JanDeDobbeleer.OhMyPosh" },
    @{name = "Python.Python.3.10" },
    @{name = "Node.js" },
    @[name = "WhatsApp.WhatsApp" },
    @{name = "OpenWhisperSystems.Signal.Beta" },
    @{name = "Microsoft.Office" },
    @{name = "Microsoft.Teams" },
    @{name = "Microsoft.VisualStudio.2022.Professional" },
    @{name = "Microsoft.WindowsAdminCenter" },
    @{name = "9P6PMZTM93LR" },
    @{name = "Microsoft.PowerAutomateDesktop" },
    @{name = "Valve.Steam" },
    @{name = "arjun-g.google-meet-desktop" },
    @{name = "Google.VPNByGoogleOne" },
    @{name = "Google.Talk" },
    @{name = "Google.GoogleDrive" },
    @{name = "Google.EarthPro" },
    @{name = "Google.Chrome" },
    @{name = "DJI.DJIAssistant2.ForMavic" },
    @{name = "Adobe.Acrobat.Reader.64-bit" },
    @{name = "XPDLPKWG9SW2WD" },
    @{name = "UbiquitiInc.IdentityDesktop" },
    @{name = "Garmin.Express" },
    @{name = "Garmin.BaseCamp" },
    @{name = "7zip.7zip" },
    @{name = "Intel.WiFiDrivers" },
    @{name = "Intel.IntelDriverAndSupportAssistant" },
    @{name = "Telegram.TelegramDesktop.Beta" },
    @{name = "" },
    @{name = "" },
    @{name = "" },
    @{name = "" },
    @{name = "Visual Studio Enterprise 2022" }
    );
    Foreach ($app in $apps) {
  18. rpbush revised this gist Feb 27, 2024. No changes.
  19. @codebytes codebytes revised this gist Mar 28, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -82,4 +82,4 @@ Foreach ($app in $apps)
    }

    #Setup WSL
    #wsl --install
    wsl --install
  20. @codebytes codebytes revised this gist Mar 28, 2023. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -50,7 +50,10 @@ $apps = @(
    @{name = "GitHub.cli" },
    @{name = "Canonical.Ubuntu.2204" },
    @{name = "GitHub.GitHubDesktop" },
    @{name = "JanDeDobbeleer.OhMyPosh" }
    @{name = "JanDeDobbeleer.OhMyPosh" },
    @{name = "Python.Python.3.10" },
    @{name = "Node.js" },
    @{name = "Visual Studio Enterprise 2022" }
    );
    Foreach ($app in $apps) {
    $listApp = winget list --exact -q $app.name --accept-source-agreements
    @@ -79,4 +82,4 @@ Foreach ($app in $apps)
    }

    #Setup WSL
    wsl --install
    #wsl --install
  21. @codebytes codebytes revised this gist Mar 28, 2023. No changes.
  22. @codebytes codebytes revised this gist Mar 28, 2023. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -47,9 +47,10 @@ $apps = @(
    @{name = "Docker.DockerDesktop" },
    @{name = "Microsoft.DotNet.SDK.6" },
    @{name = "Microsoft.DotNet.SDK.7" },
    @{name = "GitHub.cli" }
    @{name = "Canonical.Ubuntu.2204" }
    @{name = "GitHub.GitHubDesktop" }
    @{name = "GitHub.cli" },
    @{name = "Canonical.Ubuntu.2204" },
    @{name = "GitHub.GitHubDesktop" },
    @{name = "JanDeDobbeleer.OhMyPosh" }
    );
    Foreach ($app in $apps) {
    $listApp = winget list --exact -q $app.name --accept-source-agreements
  23. @codebytes codebytes revised this gist Mar 27, 2023. 1 changed file with 9 additions and 3 deletions.
    12 changes: 9 additions & 3 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -41,12 +41,15 @@ $apps = @(
    @{name = "Microsoft.PowerShell" },
    @{name = "Microsoft.VisualStudioCode" },
    @{name = "Microsoft.WindowsTerminal"; source = "msstore" },
    @{name = "Microsoft.AzureStorageExplorer" },
    @{name = "Microsoft.Azure.StorageExplorer" },
    @{name = "Microsoft.PowerToys" },
    @{name = "Git.Git" },
    @{name = "Docker.DockerDesktop" },
    @{name = "Microsoft.dotnet" },
    @{name = "Microsoft.DotNet.SDK.6" },
    @{name = "Microsoft.DotNet.SDK.7" },
    @{name = "GitHub.cli" }
    @{name = "Canonical.Ubuntu.2204" }
    @{name = "GitHub.GitHubDesktop" }
    );
    Foreach ($app in $apps) {
    $listApp = winget list --exact -q $app.name --accept-source-agreements
    @@ -72,4 +75,7 @@ Foreach ($app in $apps)
    {
    Write-host "Uninstalling:" $app
    Get-AppxPackage -allusers $app | Remove-AppxPackage
    }
    }

    #Setup WSL
    wsl --install
  24. @codebytes codebytes revised this gist Mar 27, 2023. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -49,14 +49,14 @@ $apps = @(
    @{name = "GitHub.cli" }
    );
    Foreach ($app in $apps) {
    $listApp = winget list --exact -q $app.name
    $listApp = winget list --exact -q $app.name --accept-source-agreements
    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
    winget install --exact --silent $app.name --source $app.source --accept-package-agreements
    }
    else {
    winget install --exact --silent $app.name
    winget install --exact --silent $app.name --accept-package-agreements
    }
    }
    else {
  25. @codebytes codebytes revised this gist Aug 1, 2021. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -35,6 +35,7 @@ $settingsJson =
    $settingsJson | Out-File $settingsPath -Encoding utf8

    #Install New apps
    Write-Output "Installing Apps"
    $apps = @(
    @{name = "Microsoft.AzureCLI" },
    @{name = "Microsoft.PowerShell" },
    @@ -61,4 +62,14 @@ Foreach ($app in $apps) {
    else {
    Write-host "Skipping Install of " $app.name
    }
    }

    #Remove Apps
    Write-Output "Removing Apps"

    $apps = "*3DPrint*", "Microsoft.MixedReality.Portal"
    Foreach ($app in $apps)
    {
    Write-host "Uninstalling:" $app
    Get-AppxPackage -allusers $app | Remove-AppxPackage
    }
  26. @codebytes codebytes revised this gist Aug 1, 2021. 1 changed file with 0 additions and 11 deletions.
    11 changes: 0 additions & 11 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,5 @@
    #Install WinGet
    #Based on this gist: https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901

    $hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
    if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") {
    "Installing winget Dependencies"
    @@ -35,16 +34,6 @@ $settingsJson =
    "@;
    $settingsJson | Out-File $settingsPath -Encoding utf8

    #Remove unneeded apps
    function RemoveWin10Apps {
    $apps = "*3DPrint*", "Microsoft.YourPhone", "Microsoft.MicrosoftSolitaireCollection"

    Foreach ($app in $apps) {
    Write-host "Uninstalling:" $app
    Get-AppxPackage -allusers $app | Remove-AppxPackage
    }
    }

    #Install New apps
    $apps = @(
    @{name = "Microsoft.AzureCLI" },
  27. @codebytes codebytes revised this gist Aug 1, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -60,7 +60,7 @@ $apps = @(
    );
    Foreach ($app in $apps) {
    $listApp = winget list --exact -q $app.name
    if ([String]::Join("", $listApp).Contains($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
  28. @codebytes codebytes revised this gist Aug 1, 2021. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -70,8 +70,6 @@ Foreach ($app in $apps) {
    }
    }
    else {
    {
    Write-Output "Skipping Install of " $app.name
    }
    Write-host "Skipping Install of " $app.name
    }
    }
  29. @codebytes codebytes revised this gist Aug 1, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion DevMachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -71,7 +71,7 @@ Foreach ($app in $apps) {
    }
    else {
    {
    "Skipping Install of " + $app.name
    Write-Output "Skipping Install of " $app.name
    }
    }
    }
  30. @codebytes codebytes revised this gist Aug 1, 2021. No changes.