Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Ayers Codebytes

View GitHub Profile
View DevMachineSetup.ps1
#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
// Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse);
public class Flags
{
}
public class Settings
{
public Flags flags { get; set; }
}
@Codebytes
Codebytes / nuget-install.ps1
Last active Jul 5, 2021
Powershell script to install nuget and update path
View nuget-install.ps1
$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