Closed maracre closed 1 year ago
Did you click the Raw button in Github to get the script? It looks like you have some html in there
I tried both, with Raw i got other error messages and i rightclicked in the browser on the script and SaveAs, there i get above mentioned error messages.
I tried it with your last suggestion and now we get the following error:
In C:\Temp\RemoveBloat.ps1:130 Zeichen:26
Unerwartetes Token "جميع"
$builtin = "مدمج"
}
"bg-BG" {
$everyone = "Ð’Ñички"
$builtin = "Вграден"
}
"cs-CZ" {
$everyone = "VÅ¡ichni"
$builtin = "Vestavěný"
}
"da-DK" {
$everyone = "Alle"
$builtin = "Indbygget"
}
"de-DE" {
$everyone = "Jeder"
$builtin = "Integriert"
}
"el-GR" {
$everyone = "Όλοι"
$builtin = "ΕνσωματωμÎνο"" in Ausdruck oder Anweisung.
In C:\Temp\RemoveBloat.ps1:181 Zeichen:6
Unerwartetes Token "hr-HR" {
$everyone = "Svi"
$builtin = "Ugrađeni"
}
"hu-HU" {
$everyone = "Mindenki"
$builtin = "BeépÃtett"
}
"it-IT" {
$everyone = "Tutti"
$builtin = "Incorporato"
}
"ja-JP" {
$everyone = "ã™ã¹ã¦ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼"
$builtin = "ビルトイン"" in Ausdruck oder Anweisung.
In C:\Temp\RemoveBloat.ps1:198 Zeichen:29
Unerwartetes Token "사용ìž"
$builtin = "기본 ì œê³µ"
}
"lt-LT" {
$everyone = "Visi"
$builtin = "Įmontuotas"
}
"lv-LV" {
$everyone = "Visi"
$builtin = "Iebūvēts"
}
"nb-NO" {
$everyone = "Alle"
$builtin = "Innebygd"
}
"nl-NL" {
$everyone = "Iedereen"
$builtin = "Ingebouwd"
}
"pl-PL" {
$everyone = "Wszyscy"
$builtin = "Wbudowany"
}
"pt-BR" {
$everyone = "Todos"
$builtin = "Integrado"
}
"pt-PT" {
$everyone = "Todos"
$builtin = "Incorporado"
}
"ro-RO" {
$everyone = "Toată lumea"
$builtin = "Incorporat"
}
"ru-RU" {
$everyone = "Ð’Ñе" in Ausdruck oder Anweisung.
In C:\Temp\RemoveBloat.ps1:255 Zeichen:42
Unerwartetes Token "รื่à¸à¸‡"
}
"tr-TR" {
$everyone = "Herkes"
$builtin = "YerleÅŸik"
}
"uk-UA" {
$everyone = "Ð’ÑÑ–"
$builtin = "Вбудований"
}
"zh-CN" {
$everyone = "所有人"
$builtin = "内置"
}
"zh-TW" {
$everyone = "所有人"
$builtin = "內建"
}
default {
$everyone = "Everyone"
$builtin = "Builtin"
}
}
############################################################################################################
# Remove AppX Packages #
# #
############################################################################################################
#Removes AppxPackages
$WhitelistedApps = 'Microsoft.WindowsNotepad|Microsoft.CompanyPortal|Microsoft.ScreenSketch|Microsoft.Paint3D|Micro
soft.WindowsCalculator|Microsoft.WindowsStore|Microsoft.Windows.Photos|CanonicalGroupLimited.UbuntuonWindows|`
|Microsoft.MicrosoftStickyNotes|Microsoft.MSPaint|Microsoft.WindowsCamera|.NET|Framework|`
Microsoft.HEIFImageExtension|Microsoft.ScreenSketch|Microsoft.StorePurchaseApp|Microsoft.VP9VideoExtensions|Microso
ft.WebMediaExtensions|Microsoft.WebpImageExtension|Microsoft.DesktopAppInstaller|WindSynthBerry|MIDIBerry|Slack'
#NonRemovable Apps that where getting attempted and the system would reject the uninstall, speeds up debloat and
prevents 'initalizing' overlay when removing apps
$NonRemovable = '1527c705-839a-4832-9118-54d4Bd6a0c89|c5e2524a-ea46-4f67-841f-6a9465d9d515|E2A4F912-2574-4A75-9BB0-
0D023378592B|F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE|InputApp|Microsoft.AAD.BrokerPlugin|Microsoft.AccountsControl|`
Microsoft.BioEnrollment|Microsoft.CredDialogHost|Microsoft.ECApp|Microsoft.LockApp|Microsoft.MicrosoftEdgeDevToolsC
lient|Microsoft.MicrosoftEdge|Microsoft.PPIProjection|Microsoft.Win32WebViewHost|Microsoft.Windows.Apprep.ChxApp|`
Microsoft.Windows.AssignedAccessLockApp|Microsoft.Windows.CapturePicker|Microsoft.Windows.CloudExperienceHost|Micro
soft.Windows.ContentDeliveryManager|Microsoft.Windows.Cortana|Microsoft.Windows.NarratorQuickStart|`
Microsoft.Windows.ParentalControls|Microsoft.Windows.PeopleExperienceHost|Microsoft.Windows.PinningConfirmationDial
og|Microsoft.Windows.SecHealthUI|Microsoft.Windows.SecureAssessmentBrowser|Microsoft.Windows.ShellExperienceHost|`
Microsoft.Windows.XGpuEjectDialog|Microsoft.XboxGameCallableUI|Windows.CBSPreview|windows.immersivecontrolpanel|Win
dows.PrintDialog|Microsoft.XboxGameCallableUI|Microsoft.VCLibs.140.00|Microsoft.Services.Store.Engagement|Microsoft.UI.
Xaml.2.0|*Nvidia*'
Get-AppxPackage -AllUsers | Where-Object {$_.Name -NotMatch $WhitelistedApps -and $_.Name -NotMatch $NonRemovable}
| Remove-AppxPackage
Get-AppxPackage -allusers | Where-Object {$_.Name -NotMatch $WhitelistedApps -and $_.Name -NotMatch $NonRemovable}
| Remove-AppxPackage
Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName -NotMatch $WhitelistedApps -and $_.PackageName
-NotMatch $NonRemovable} | Remove-AppxProvisionedPackage -Online
##Remove bloat
$Bloatware = @(
#Unnecessary Windows 10/11 AppX Apps
"Microsoft.BingNews"
"Microsoft.GetHelp"
"Microsoft.Getstarted"
"Microsoft.Messaging"
"Microsoft.Microsoft3DViewer"
"Microsoft.MicrosoftOfficeHub"
"Microsoft.MicrosoftSolitaireCollection"
"Microsoft.NetworkSpeedTest"
"Microsoft.MixedReality.Portal"
"Microsoft.News"
"Microsoft.Office.Lens"
"Microsoft.Office.OneNote"
"Microsoft.Office.Sway"
"Microsoft.OneConnect"
"Microsoft.People"
"Microsoft.Print3D"
"Microsoft.RemoteDesktop"
"Microsoft.SkypeApp"
"Microsoft.StorePurchaseApp"
"Microsoft.Office.Todo.List"
"Microsoft.Whiteboard"
"Microsoft.WindowsAlarms"
#"Microsoft.WindowsCamera"
"microsoft.windowscommunicationsapps"
"Microsoft.WindowsFeedbackHub"
"Microsoft.WindowsMaps"
"Microsoft.WindowsSoundRecorder"
"Microsoft.Xbox.TCUI"
"Microsoft.XboxApp"
"Microsoft.XboxGameOverlay"
"Microsoft.XboxIdentityProvider"
"Microsoft.XboxSpeechToTextOverlay"
"Microsoft.ZuneMusic"
"Microsoft.ZuneVideo"
"MicrosoftTeams"
"Microsoft.YourPhone"
"Microsoft.XboxGamingOverlay_5.721.10202.0_neutral_~_8wekyb3d8bbwe"
"Microsoft.GamingApp"
"SpotifyAB.SpotifyMusic"
"Disney.37853FC22B2CE"
"*EclipseManager*"
"*ActiproSoftwareLLC*"
"*AdobeSystemsIncorporated.AdobePhotoshopExpress*"
"*Duolingo-LearnLanguagesforFree*"
"*PandoraMediaInc*"
"*CandyCrush*"
"*BubbleWitch3Saga*"
"*Wunderlist*"
"*Flipboard*"
"*Twitter*"
"*Facebook*"
"*Spotify*"
"*Minecraft*"
"*Royal" in Ausdruck oder Anweisung.
In C:\Temp\RemoveBloat.ps1:813 Zeichen:20
I've just run the script on a fresh Win11 22H2 build with the German language pack activated and it completed without any errors. How are you running the script?
im running the script, without and with admin privilages, in the powershell installed with my pc. My User is a domainuser, with local admin rights.
If you run just this part, what value do you get for $everyone and $builtin? $locale = Get-WinSystemLocale | Select-Object -expandproperty Name
switch ($locale) {
"ar-SA" {
$everyone = "الجميع"
$builtin = "مدمج"
}
"bg-BG" {
$everyone = "Всички"
$builtin = "Вграден"
}
"cs-CZ" {
$everyone = "Všichni"
$builtin = "Vestavěný"
}
"da-DK" {
$everyone = "Alle"
$builtin = "Indbygget"
}
"de-DE" {
$everyone = "Jeder"
$builtin = "Integriert"
}
"el-GR" {
$everyone = "Όλοι"
$builtin = "Ενσωματωμένο"
}
"en-US" {
$everyone = "Everyone"
$builtin = "Builtin"
}
"en-GB" {
$everyone = "Everyone"
$builtin = "Builtin"
}
"es-ES" {
$everyone = "Todos"
$builtin = "Incorporado"
}
"et-EE" {
$everyone = "Kõik"
$builtin = "Sisseehitatud"
}
"fi-FI" {
$everyone = "Kaikki"
$builtin = "Sisäänrakennettu"
}
"fr-FR" {
$everyone = "Tout le monde"
$builtin = "Intégré"
}
"he-IL" {
$everyone = "כולם"
$builtin = "מובנה"
}
"hr-HR" {
$everyone = "Svi"
$builtin = "Ugrađeni"
}
"hu-HU" {
$everyone = "Mindenki"
$builtin = "Beépített"
}
"it-IT" {
$everyone = "Tutti"
$builtin = "Incorporato"
}
"ja-JP" {
$everyone = "すべてのユーザー"
$builtin = "ビルトイン"
}
"ko-KR" {
$everyone = "모든 사용자"
$builtin = "기본 제공"
}
"lt-LT" {
$everyone = "Visi"
$builtin = "Įmontuotas"
}
"lv-LV" {
$everyone = "Visi"
$builtin = "Iebūvēts"
}
"nb-NO" {
$everyone = "Alle"
$builtin = "Innebygd"
}
"nl-NL" {
$everyone = "Iedereen"
$builtin = "Ingebouwd"
}
"pl-PL" {
$everyone = "Wszyscy"
$builtin = "Wbudowany"
}
"pt-BR" {
$everyone = "Todos"
$builtin = "Integrado"
}
"pt-PT" {
$everyone = "Todos"
$builtin = "Incorporado"
}
"ro-RO" {
$everyone = "Toată lumea"
$builtin = "Incorporat"
}
"ru-RU" {
$everyone = "Все пользователи"
$builtin = "Встроенный"
}
"sk-SK" {
$everyone = "Všetci"
$builtin = "Vstavaný"
}
"sl-SI" {
$everyone = "Vsi"
$builtin = "Vgrajen"
}
"sr-Latn-RS" {
$everyone = "Svi"
$builtin = "Ugrađeni"
}
"sv-SE" {
$everyone = "Alla"
$builtin = "Inbyggd"
}
"th-TH" {
$everyone = "ทุกคน"
$builtin = "ภายในเครื่อง"
}
"tr-TR" {
$everyone = "Herkes"
$builtin = "Yerleşik"
}
"uk-UA" {
$everyone = "Всі"
$builtin = "Вбудований"
}
"zh-CN" {
$everyone = "所有人"
$builtin = "内置"
}
"zh-TW" {
$everyone = "所有人"
$builtin = "內建"
}
default {
$everyone = "Everyone"
$builtin = "Builtin"
}
}
when i try it, like you suggested, i get no value back.
You won't, you'll need to ask it what the variables are
When i try it and i type in the Variable $locale it says de-DE.
That part is working then, you may need to step through the script and see which line is failing
Hello,
i tested your new script and we get the following Errors:
Its tested on a Windows 11 Enterprise Client.