LeDragoX / Win-Debloat-Tools

Re-imagining Windows like a minimal OS install, already debloated with minimal impact for most functionality.
MIT License
4.82k stars 245 forks source link

CLI argument does not work if not administrator #136

Closed timiskander closed 7 months ago

timiskander commented 7 months ago

Describe the Bug

When executing the WinDebloatTools.ps1 script from a non-admin shell (particularly cmd.exe) the arguments are dropped in the process of obtaining admin privileges. I am not a powershell savvy guy, but I thing the issue is in the Request-AdminPrivilege() function, the call is made to start the process passing "$PSCommandPath without $Mode

The log shows Arguments: None, running GUI

How can this issue be reproduced?

Run the script from a non-admin shell: CMD: powershell -File .\WinDebloatTools.ps1 CLI PS> .\WinDebloatTools.ps1 CLI

Expected behavior?

Expected CLI argument to invoke CLI version...

Operating System

Windows 11

Operating System Version

Version 10.0.22621 Build 22621

Logs

WinDebloatTools-2023-11.log

timiskander commented 7 months ago

@LeDragoX - Thanks for the super quick fix on this!!! checked out develop branch and it worked like as it should 👍