t1m0thyj / WDD-scripts

PowerShell scripts that add features to WinDynamicDesktop
83 stars 19 forks source link

Change brightness script encounters an error whenever triggered #49

Open jay-chorus opened 3 months ago

jay-chorus commented 3 months ago

Steps to Reproduce:

  1. App was run with both Standard and Elevated privileges
  2. Latest scripts were used

Are you using the Microsoft Store version of WDD?: No image

t1m0thyj commented 3 months ago

Not sure what would cause the WmiSetBrightness method to be missing. The way that ChangeDisplayBrightness.ps1 sets brightness matches the example script in Microsoft docs here.

Could you check your version of PowerShell by running powershell $PSVersionTable in a Command Prompt to ensure you have the latest version installed and on your PATH?

t1m0thyj commented 3 months ago

If you are using a desktop that doesn't have screen brightness control built-in to Windows, you may have better luck with this script: https://github.com/t1m0thyj/WDD-scripts/pull/22

jay-chorus commented 3 months ago

After some troubleshooting, I narrowed it down to an unknown conflict with Powershell7. Apparently having Powershell7 installed will cause windows to use that as a default when running scripts. I still think the exact cause is unknown since manually running the brightness command on line 22, in an instance of Powershell7, will still give the same output as regular Windows Powershell