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
# Things to note | |
# Single script, will survive reboot | |
# Script needs to be run under admin (will auto correct if not) | |
# Script needs internet access to download files | |
# Script assumes WinGet is installed | |
# | |
# Why aren't we using wsl --install -d Ubuntu | |
# Well, we want to WSL.exe install a bunch of stuff | |
# Ubuntu2004 install --root can't be done above so it requires user interaction | |
# if you don't need to install items on linux without setting root, this script becomes much simplier |
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
# Things to note | |
# Script needs internet access to download files | |
# Script assumes WinGet is installed | |
# Script will remotely grab the json fragments and import for winget | |
# Script assumes winget's setting has this line in it: experimentalFeatures": { "import": true }, | |
$mypath = $MyInvocation.MyCommand.Path | |
$isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) | |
# Restarting as Admin |
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
function InstallWinGet() | |
{ | |
$hasPackageManager = Get-AppPackage -name "Microsoft.DesktopAppInstaller" | |
if(!$hasPackageManager) | |
{ | |
$releases_url = "https://api.github.com/repos/microsoft/winget-cli/releases/latest" | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
$releases = Invoke-RestMethod -uri "$($releases_url)" |