Skip to content

Instantly share code, notes, and snippets.


Chris Ayers Codebytes

View GitHub Profile
View DevMachineSetup.ps1
#Install WinGet
#Based on this gist:
$hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"") {
"Installing winget Dependencies"
Add-AppxPackage -Path ''
$releases_url = ''
[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 / nuget-install.ps1
Last active Jul 5, 2021
Powershell script to install nuget and update path
View nuget-install.ps1
$sourceNugetExe = ""
$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