lptstr / winfetch

🛠 A command-line system information utility written in PowerShell. Like Neofetch, but for Windows.
MIT License
1.35k stars 76 forks source link

CmdletBinding error on line 70 (Windows 10/11) #190

Closed audacenoire closed 11 months ago

audacenoire commented 1 year ago

So I'm attempting to build from source to update clist >> choco list, but when I run the new script, I get the following error:

ParserError: C:\Users\Audie\Downloads\winfetch-2.5.0\winfetch.ps1:70 Line | 70 | [CmdletBinding()] | ~~~~~~~~~~~~~~~~~ | Unexpected attribute 'CmdletBinding'

I attempted this on two computers running Windows 10 and 11, with the same effect.

SliceTheDuck commented 1 year ago

I am unable to reproduce the bug, any specific steps to reproduce?

audacenoire commented 1 year ago

I am unable to reproduce the bug, any specific steps to reproduce?

  1. Download winfetch-2.5.0 from releases page and unzip into any directory
  2. Open a PowerShell prompt, cd to the directory containing the winfetch.ps1 file
  3. Run ./winfetch.ps1
ghost commented 1 year ago

Can confirm on Win11 (installed via Scoop). Unable to replicate on Win10, also installed via Scoop.

winfetcherror

audacenoire commented 1 year ago

Can confirm on Win11 (installed via Scoop). Unable to replicate on Win10, also installed via Scoop.

winfetcherror

The newest update is supposed to fix the clist error because the command now used by Chocolatey is choco list.

But it's that new version that's giving the CmdletBinding attribute error.

I want to add that this error only seems to happen when I try to run winfetch from inside a PowerShell instance. When I try to run the script directly from File Explorer, I get another, much longer error, but the window closes before I can read what it says.

rashil2000 commented 11 months ago

Discussion is here at #189