-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwinget-check.ps1
28 lines (22 loc) · 2.22 KB
/
winget-check.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Write-Output "
██████╗ ██╗ ██╗███████╗ ██████╗██╗ ██╗ ██╗ ██╗██╗███╗ ██╗ ██████╗ ███████╗████████╗
██╔════╝██║ ██║██╔════╝██╔════╝██║ ██╔╝ ██║ ██║██║████╗ ██║██╔════╝ ██╔════╝╚══██╔══╝
██║ ███████║█████╗ ██║ █████╔╝ ██║ █╗ ██║██║██╔██╗ ██║██║ ███╗█████╗ ██║
██║ ██╔══██║██╔══╝ ██║ ██╔═██╗ ██║███╗██║██║██║╚██╗██║██║ ██║██╔══╝ ██║
╚██████╗██║ ██║███████╗╚██████╗██║ ██╗ ╚███╔███╔╝██║██║ ╚████║╚██████╔╝███████╗ ██║
╚═════╝╚═╝ ╚═╝╚══════╝ ╚═════╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚══════╝ ╚═╝
"
# Check if Winget is installed
$wingetCheck = (Get-Command "winget" -ErrorAction SilentlyContinue)
if ($null -eq $wingetCheck) {
Write-Host "Winget is not installed. Installing Winget..."
$wingetInstallerUrl = "https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.appxbundle"
$tempFile = "$env:TEMP\winget.appxbundle"
# Download the Winget installer
Invoke-WebRequest -Uri $wingetInstallerUrl -OutFile $tempFile
# Install Winget
Add-AppxPackage -Path $tempFile
Write-Host "Winget installation completed."
} else {
Write-Host "Winget is already installed."
}