mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 11:06:18 +00:00
Win11Debloat now manually checks if git is installed (#59)
This commit is contained in:
15
Get.ps1
15
Get.ps1
@@ -42,18 +42,25 @@ Write-Output "------------------------------------------------------------------
|
|||||||
|
|
||||||
# Make sure winget is installed and is at least v1.4
|
# Make sure winget is installed and is at least v1.4
|
||||||
if ((Get-AppxPackage -Name "*Microsoft.DesktopAppInstaller*") -and ((winget -v) -replace 'v','' -gt 1.4)) {
|
if ((Get-AppxPackage -Name "*Microsoft.DesktopAppInstaller*") -and ((winget -v) -replace 'v','' -gt 1.4)) {
|
||||||
# Install git if it isn't already installed
|
# Check if git is installed. Install git if it isn't installed yet
|
||||||
|
try
|
||||||
|
{
|
||||||
|
git | Out-Null
|
||||||
|
}
|
||||||
|
catch [System.Management.Automation.CommandNotFoundException]
|
||||||
|
{
|
||||||
Write-Output "> Installing git..."
|
Write-Output "> Installing git..."
|
||||||
winget install git.git --accept-package-agreements --accept-source-agreements --disable-interactivity --no-upgrade
|
winget install git.git --accept-package-agreements --accept-source-agreements --disable-interactivity --no-upgrade
|
||||||
|
|
||||||
|
Write-Output ""
|
||||||
|
}
|
||||||
|
|
||||||
# Navigate to user temp directory
|
# Navigate to user temp directory
|
||||||
cd $env:TEMP
|
cd $env:TEMP
|
||||||
|
|
||||||
# Add default install location of git to path
|
# Add default install location of git to path
|
||||||
$env:Path += ';C:\Program Files\Git\cmd'
|
$env:Path += ';C:\Program Files\Git\cmd'
|
||||||
|
|
||||||
Write-Output ""
|
|
||||||
|
|
||||||
# Download Win11Debloat from github
|
# Download Win11Debloat from github
|
||||||
Write-Output "> Downloading Win11Debloat..."
|
Write-Output "> Downloading Win11Debloat..."
|
||||||
git clone https://github.com/Raphire/Win11Debloat/
|
git clone https://github.com/Raphire/Win11Debloat/
|
||||||
@@ -75,5 +82,5 @@ if ((Get-AppxPackage -Name "*Microsoft.DesktopAppInstaller*") -and ((winget -v)
|
|||||||
Remove-Item -LiteralPath "Win11Debloat" -Force -Recurse
|
Remove-Item -LiteralPath "Win11Debloat" -Force -Recurse
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Write-Error "Unable to start script, Winget is not installed or outdated."
|
Write-Error "Unable to start script, WinGet is not installed or outdated."
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user