mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 11:06:18 +00:00
Compare commits
2 Commits
2025.09.07
...
2025.09.08
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
260895618d | ||
|
|
a662273414 |
2
Get.ps1
2
Get.ps1
@@ -85,7 +85,7 @@ Write-Output "------------------------------------------------------------------
|
|||||||
Write-Output "> Downloading Win11Debloat..."
|
Write-Output "> Downloading Win11Debloat..."
|
||||||
|
|
||||||
# Download latest version of Win11Debloat from github as zip archive
|
# Download latest version of Win11Debloat from github as zip archive
|
||||||
Invoke-RestMethod https://api.github.com/repos/Raphire/Win11Debloat/zipball/2025.09.07 -OutFile "$env:TEMP/win11debloat.zip"
|
Invoke-RestMethod https://api.github.com/repos/Raphire/Win11Debloat/zipball/2025.09.08 -OutFile "$env:TEMP/win11debloat.zip"
|
||||||
|
|
||||||
# Remove old script folder if it exists, except for CustomAppsList and SavedSettings files
|
# Remove old script folder if it exists, except for CustomAppsList and SavedSettings files
|
||||||
if (Test-Path "$env:TEMP/Win11Debloat") {
|
if (Test-Path "$env:TEMP/Win11Debloat") {
|
||||||
|
|||||||
@@ -575,21 +575,26 @@ function CheckModernStandbySupport {
|
|||||||
function GetUserDirectory {
|
function GetUserDirectory {
|
||||||
param (
|
param (
|
||||||
$userName,
|
$userName,
|
||||||
$fileName = ""
|
$fileName = "",
|
||||||
|
$exitIfPathNotFound = $true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
$userDirectoryExists = Test-Path "$env:SystemDrive\Users\$userName"
|
||||||
$userPath = "$env:SystemDrive\Users\$userName\$fileName"
|
$userPath = "$env:SystemDrive\Users\$userName\$fileName"
|
||||||
|
|
||||||
if (-not (Test-Path $userPath)) {
|
if ((Test-Path $userPath) -or ($userDirectoryExists -and (-not $exitIfPathNotFound))) {
|
||||||
$userPath = $env:USERPROFILE -Replace ('\\' + $env:USERNAME + '$'), "\$userName\$fileName"
|
return $userPath
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not (Test-Path $userPath)) {
|
$userDirectoryExists = Test-Path $env:USERPROFILE -Replace ('\\' + $env:USERNAME + '$'), "\$userName"
|
||||||
Write-Host "Error: Unable to find user directory path for user $userName" -ForegroundColor Red
|
$userPath = $env:USERPROFILE -Replace ('\\' + $env:USERNAME + '$'), "\$userName\$fileName"
|
||||||
AwaitKeyToExit
|
|
||||||
|
if ((Test-Path $userPath) -or ($userDirectoryExists -and (-not $exitIfPathNotFound))) {
|
||||||
|
return $userPath
|
||||||
}
|
}
|
||||||
|
|
||||||
return $userPath
|
Write-Host "Error: Unable to find user directory path for user $userName" -ForegroundColor Red
|
||||||
|
AwaitKeyToExit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -682,7 +687,7 @@ function ReplaceStartMenuForAllUsers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Also replace the start menu file for the default user profile
|
# Also replace the start menu file for the default user profile
|
||||||
$defaultStartMenuPath = GetUserDirectory -userName "Default" -fileName "AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState"
|
$defaultStartMenuPath = GetUserDirectory -userName "Default" -fileName "AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState" -exitIfPathNotFound $false
|
||||||
|
|
||||||
# Create folder if it doesn't exist
|
# Create folder if it doesn't exist
|
||||||
if (-not (Test-Path $defaultStartMenuPath)) {
|
if (-not (Test-Path $defaultStartMenuPath)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user