SimonCropp / WinDebloat

A dotnet tool that removes the bloat in Windows
MIT License
430 stars 24 forks source link

Added quotes around values for PowerShell commands #22

Closed beeradmoore closed 1 year ago

beeradmoore commented 1 year ago

When attempting to use the PowerShell commands I click the copy icon on GitHub and attempt to paste it into Windows Terminal and the values do not appear.

Screenshot 2023-08-06 121739 (EDIT: Screenshot does shows Terminal not running as admin, running as admin which is required for some of the updates also does not work)

I confirmed by pasting into a VSCode window that the values are being copied. Copying from VSCode into Terminal also did not solve the issue. Additionally pasting into a Terminal window that has command prompt allows the original paste to work fine, but this then won't execute. Maybe something is up with PowerShell itself?

Adding double quotes around the values allows them to copy/paste as expected. I don't know if this is the correct way to use PowerShell or if something is off on my end.

I am using Win11 22H2 with Windows Terminal v1.17.11461.0.

Also please note that the update was performed with regex in VSCode find/replace.

Set-ItemProperty -Path (.*) -Name (.*) -Type (.*) -Value (.*)$
Set-ItemProperty -Path "$1" -Name "$2" -Type "$3" -Value "$4"

After the change I did run some of these commands manually which I wanted to apply and then confirmed (with only one) that the value was updated in regedit as expected.

SimonCropp commented 1 year ago

that is very weird. i dont have the same problem. by powershell is a weird beast.

and those string are code generated so i fixed it in a diff commit https://github.com/SimonCropp/WinDebloat/commit/af53f0f27109168b02fdb0d40967d6c07d0cdb7d

let me know if those work better

beeradmoore commented 1 year ago

Those additional changes you did appear to nuke the registry.

image

This is Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search before I run the following command.

New-Item -Path "Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search" -Force
Set-ItemProperty -Path "Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Type "DWord" -Value "0"

and then after,

image

Restarting Explorer.exe will bring them all back, so in this case it may be fine. But is that the case for everywhere you now call New-Item?

EDIT: That command also does not hide taskbar search even after a reload. I'll report as a new issue later.

SimonCropp commented 1 year ago

sigh. i will revert that change

SimonCropp commented 1 year ago

guess i need an if exists check