View DevMachineSetup.ps1
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
#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 |
View classes.cs
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
// Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse); | |
public class Flags | |
{ | |
} | |
public class Settings | |
{ | |
public Flags flags { get; set; } | |
} |
View nuget-install.ps1
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
$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" | |
$targetPath = "C:\Program Files\nuget" | |
if (-not (Test-Path -LiteralPath $targetPath)) { | |
try { | |
New-Item -Path $targetPath -ItemType Directory -ErrorAction Stop | Out-Null #-Force | |
} | |
catch { | |
Write-Error -Message "Unable to create directory '$targetPath'. Error was: $_" -ErrorAction Stop |