Bug: CommandNotFoundException for SystemSettingsAdminFlows breaks script on line 1069
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 74/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- powershell
- Lĩnh vực
- operating-systems
Hướng nghiên cứu
Bắt đầu tại dòng 1069 trong script PowerShell và tái hiện lỗi khi SystemSettingsAdminFlows không khả dụng. Kiểm tra các cách sử dụng Get-Command khác được đề cập trong issue để xác định cùng kiểu lỗi. Hoàn thành khi giai đoạn loại bỏ Edge AI bỏ qua một lệnh bị thiếu và tiếp tục mà không gặp CommandNotFoundException không được xử lý.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Title: Script crashes during Edge AI removal: Get-Command SystemSettingsAdminFlows throws CommandNotFoundException (line 1069)
Describe the bug
The script crashes at line 1069 during the Edge AI removal phase with a CommandNotFoundException.
The script checks for SystemSettingsAdminFlows like this:
if (Test-Path (get-command SystemSettingsAdminFlows).Source) {
If SystemSettingsAdminFlows is missing from the system (e.g. it was previously removed or debloated), Get-Command raises an error, and the script stops before Test-Path can evaluate to $false. Most likely the error becomes terminating because of $ErrorActionPreference = 'Stop' set in the script.
Steps to reproduce
- Use a system where
SystemSettingsAdminFlows.exeis missing or unavailable inPATH. - Run the script and proceed to the Edge AI removal phase.
- The script fails at line 1069.
Expected behavior
If SystemSettingsAdminFlows is not found, the script should skip this step and continue.
Actual behavior
The script terminates with an unhandled error.
Error log
get-command : Имя "SystemSettingsAdminFlows" не распознано как имя командлета, функции, файла сценария или выполняемой программы. Проверьте правильность написания имени, а также наличие и правильность пути, после чего повторите попытку.
строка:1069 знак:20
+ if (Test-Path (get-command SystemSettingsAdminFlows).Source) {
+ CategoryInfo : ObjectNotFound: (SystemSettingsAdminFlows:String) [Get-Command], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand
Suggested fix
Option 1 (minimal): suppress the error and check the result.
$cmd = Get-Command SystemSettingsAdminFlows -CommandType Application -ErrorAction SilentlyContinue
if ($cmd) {
# Proceed with execution
}
Option 2 (most predictable): check the file by its full path, without depending on PATH.
$exe = Join-Path $env:SystemRoot 'System32\SystemSettingsAdminFlows.exe'
if (Test-Path -LiteralPath $exe) {
# Proceed with execution
}
-CommandType Application excludes functions and aliases, whose .Source can be empty or a module name, so the extra Test-Path is not needed in Option 1.
Additional notes
Other Get-Command ...).Source calls elsewhere in the script may have the same problem when a component was already removed. It's worth auditing all Get-Command usages and adding -ErrorAction SilentlyContinue or a full-path check.
Environment
- OS: Windows 11 25h2
- PowerShell: 5.1
- Script version / commit: Latest as of 30.09.2026
- Ngôn ngữ chính
- PowerShell
- Star
- 13.4k
- Fork
- 470
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của zoicware/RemoveWindowsAI
-
enhancement help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
zoicware/RemoveWindowsAI#258 · 8 bình luận ·
-
Improve logging functionCó thể làm lại được @zoicware đã nhận 61 ngày trước và không có pull request nào đang mở. Đang mởenhancement
zoicware/RemoveWindowsAI#232 · 2 bình luận · 1 người được giao ·
-
Windows Update Repair OptionCó thể làm lại được @zoicware đã nhận 229 ngày trước và không có pull request nào đang mở. Đang mởdocumentation leave open
zoicware/RemoveWindowsAI#180 · 8 bình luận · 1 người được giao ·
-
DO NOT USE THESE DOWNLOAD SITESĐang mởdocumentation leave open
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 28/100
zoicware/RemoveWindowsAI#168 · 26 reaction ·
-
Anti-virus Issues (WILL NOT FIX)Đang mởbug leave open wontfix
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
zoicware/RemoveWindowsAI#140 · 4 bình luận · 3 reaction ·
Tất cả issue của zoicware/RemoveWindowsAI
Issue tương tự
-
Mark ignored Mac OS partitions RecoveryOSContainer and iBootSystemContainerCó thể đã có người làm @meven đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
storaged-project/udisks#1559 ·
-
agent:Windows security testing windows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 3 ngày
-
component:ktuner
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
agentic-os-org/ANOLISA#8597 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
HID windows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
libusb/libusb#1977 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày