WSL+CHOCOLATEY+POWERSHELL+WINGET
Tags: wsl, chocolatey, powershell, winget
Published: 2020-06-04 00:26:07

#WSL
```cmd
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
```cmd
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
```cmd
Invoke-WebRequest -Uri https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi -OutFile WSLUpdate.msi -UseBasicParsing
```
```cmd
msiexec.exe /package WSLUpdate.msi /quiet
```
```cmd
wsl --set-default-version 2
```
```cmd
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
```
```cmd
Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile Ubuntu.appx -UseBasicParsing
```
```cmd
Add-AppxPackage .\Ubuntu.appx
```

Font:
https://docs.microsoft.com/pt-br/windows/wsl/install-win10
https://docs.microsoft.com/en-us/windows/wsl/install-manual

#CHOCOLATEY
```cmd
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
```
```cmd
choco install microsoft-windows-terminal microsoft-teams vscode atom git terraform awscli lxc multipass nano nmap wget curl
```

Font:
https://chocolatey.org/install

#POWERSHELL
```cmd
Invoke-WebRequest -Uri https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/PowerShell-7.0.1-win-x64.msi -OutFile PowerShell.msi -UseBasicParsing
```
```cmd
msiexec.exe /package PowerShell.msi /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1
```

OR

```cmd
Invoke-WebRequest -Uri https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/PowerShell-7.0.1-win-x64.msix -OutFile PowerShell.msix -UseBasicParsing
```
```cmd
Add-AppxPackage PowerShell.msix
```

#POWERSHELL CORE
```cmd
Invoke-WebRequest -Uri https://github.com/PowerShell/PowerShell/releases/download/v6.2.5/PowerShell-6.2.5-win-x64.msi -OutFile PowerShellCore.msi -UseBasicParsing
```
```cmd
msiexec.exe /package PowerShellCore.msi /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1
```

OR

```cmd
Invoke-WebRequest -Uri https://github.com/PowerShell/PowerShell/releases/download/v6.2.5/PowerShell-6.2.5-win-x64.msix -OutFile PowerShellCore.msix -UseBasicParsing
```
```cmd
Add-AppxPackage PowerShellCore.msix
```

Font:
https://docs.microsoft.com/pt-br/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-7
https://github.com/PowerShell/PowerShell/releases
https://devblogs.microsoft.com/powershell/powershell-core-6-0-generally-available-ga-and-supported/

#WINGET
```cmd
Invoke-WebRequest -Uri https://github.com/microsoft/winget-cli/releases/download/v0.1.4331-preview/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.appxbundle -OutFile Winget.appx -UseBasicParsing
```
```cmd
Add-AppxPackage .\Winget.appx
```

Font:
https://github.com/microsoft/winget-cli/blob/master/README.md
https://github.com/microsoft/winget-cli/releases/tag/v0.1.4331-preview

#MICROSOFT EDGE
```cmd
Invoke-WebRequest -Uri http://dl.delivery.mp.microsoft.com/filestreamingservice/files/1fc0c5fe-c1f5-4879-a43c-515d9f731444/MicrosoftEdgeEnterpriseX64.msi  -OutFile MicrosoftEdge.msi -UseBasicParsing
```
```cmd
msiexec.exe /package MicrosoftEdge.msi /quiet
```

Font:
https://www.microsoft.com/en-us/edge/business/download
http://dl.delivery.mp.microsoft.com/filestreamingservice/files/1fc0c5fe-c1f5-4879-a43c-515d9f731444/MicrosoftEdgeEnterpriseX64.msi

#REDUCE WINSXS
```cmd
dism.exe /online /cleanup-image /spsuperseded /hidesp
```