Git Product home page Git Product logo

Comments (19)

audacenoire avatar audacenoire commented on June 11, 2024 2
InvalidArgument: C:\tools\winfetch\winfetch.ps1:875
Line |
 875 |          $chocopkg = (& choco list -l)[-1].Split(' ')[0] - 1
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot convert value "Invalid" to type "System.Int32". Error:
     | "The input string 'Invalid' was not in a correct format." 

I get this error when I try to fix the code manually.

from winfetch.

tordenflesk avatar tordenflesk commented on June 11, 2024 2

sure @rashil2000 , could you explain how do i download the modified code? sorry i'm not too practical yet with PRs and things

https://raw.githubusercontent.com/lptstr/winfetch/cc3830a61f445964a9c02192579205f2608fa76a/winfetch.ps1

https://i.imgur.com/zaOWyBQ.png

from winfetch.

AlexKari avatar AlexKari commented on June 11, 2024 1

this is easily fixed by substituting the line 875
$chocopkg = (& clist -l)[-1].Split(' ')[0] - 1
with this
$chocopkg = (& choco list)[-1].Split(' ')[0] - 1

from winfetch.

Windos avatar Windos commented on June 11, 2024 1

There is a PR open (#191) regarding the -l/--local-only option.

I've suggested a change to that PR which will solve the syntax difference between Chocolatey CLI 2.x and prior versions.

from winfetch.

aetonsi avatar aetonsi commented on June 11, 2024 1

working without any problem in win11 + [choco v1 OR choco v2] + [pwsh7 OR powershell5]
so i tested everything for win11. i do not have win10

from winfetch.

aetonsi avatar aetonsi commented on June 11, 2024 1

@rashil2000 hi i just got this result, any idea why choco packages might be -1? unluckily i closed the window right away so i have no info about the problem, and i cannot reproduce it...

(the show-winfetch function is still the same as here #181 (comment) plus -logo 'windows xp' and 'winget' added to the showpkgs list)

> Show-Winfetch
         ,.=:!!t3Z3z.,                 u6@NOTEBOOK3W
        :tt:::tt333EE3                 -------------
        Et:::ztt33EEE  @Ee.,      ..,  OS: Windows 11 Pro N [64-bit]
       ;tt:::tt333EE7 ;EEEEEEttttt33#  Host: HP HP Pavilion Laptop 15-eh0xxx
      :Et:::zt333EEQ. SEEEEEttttt33QL  Kernel: 10.0.22631.0
      it::::tt333EEF @EEEEEEttttt33F   Motherboard: HP 87C5
     ;3=*^```'*4EEV :EEEEEEttttt33@.   Uptime: 4 hours 13 minutes
     ,.=::::it=., ` @EEEEEEtttz33QF    Resolution: 1536x864, 1920x1080
    ;::::::::zt33)   '4EEEtttji3P*     PS Packages: 6 Modules
   :t::::::::tt33 :Z3z..  `` ,..g.     Packages: 230 (system), -1 (choco), 7 (scoop)
   i::::::::zt33F AEEEtttt::::ztF      Shell: PowerShell v7.3.7
  ;:::::::::t33V ;EEEttttt::::t3       Terminal: Windows Terminal

...

from winfetch.

rashil2000 avatar rashil2000 commented on June 11, 2024 1

I don't know for sure, on top of my head. Let me know if it occurs again

from winfetch.

rashil2000 avatar rashil2000 commented on June 11, 2024

What's the behaviour when we type choco list -l in Chocolatey v2?

from winfetch.

aetonsi avatar aetonsi commented on June 11, 2024

What's the behaviour when we type choco list -l in Chocolatey v2?

> choco list -l
Chocolatey v2.0.0
Invalid argument -l. This argument has been removed from the list command and cannot be used.

this is easily fixed by substituting the line 875 $chocopkg = (& clist -l)[-1].Split(' ')[0] - 1 with this $chocopkg = (& choco list)[-1].Split(' ')[0] - 1

choco list without -lo in chocolatey v1 lists all of the available packages (uses remote sources), not the locally installed ones

> choco list
Chocolatey v1.4.0
Using the list command with remote sources is deprecated and will be made
to only list locally installed packages in v2.0.0. Use the search, or find,
command to find packages on remote sources (such as the Chocolatey Community
Repository).
cpfixit 5.0.16772.0 [Approved] Downloads cached for licensed users
git-sizer 1.5.0 [Approved]

...

jackett 0.21.128 [Approved]
6805 packages found.

Did you know Pro / Business automatically syncs with Programs and
 Features? Learn more about Package Synchronizer at
 https://chocolatey.org/compare

from winfetch.

justin13888 avatar justin13888 commented on June 11, 2024

I'm using chocolatey 2.0.0 and I don't have clist command in path.

from winfetch.

aetonsi avatar aetonsi commented on June 11, 2024

because it doesn't exist anymore

from winfetch.

SliceTheDuck avatar SliceTheDuck commented on June 11, 2024

this has been fixed in april just never pushed to scoop etc.

from winfetch.

audacenoire avatar audacenoire commented on June 11, 2024

Do I have to fix the source code manually until the new version is pushed?

from winfetch.

SliceTheDuck avatar SliceTheDuck commented on June 11, 2024

You could build it from the repo or replace it yes, once you replaced it unless you updated or redownload it(when you compile yourself this ain't Gon happen) it stays fixed

from winfetch.

tordenflesk avatar tordenflesk commented on June 11, 2024
InvalidArgument: C:\tools\winfetch\winfetch.ps1:875
Line |
 875 |          $chocopkg = (& choco list -l)[-1].Split(' ')[0] - 1
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot convert value "Invalid" to type "System.Int32". Error:
     | "The input string 'Invalid' was not in a correct format." 

I get this error when I try to fix the code manually.

Remove the -l

from winfetch.

rashil2000 avatar rashil2000 commented on June 11, 2024

It would be helpful if y'all could help test PR #191

from winfetch.

aetonsi avatar aetonsi commented on June 11, 2024

sure @rashil2000 , could you explain how do i download the modified code? sorry i'm not too practical yet with PRs and things

from winfetch.

ariyako avatar ariyako commented on June 11, 2024

can confirm this still not solve on Windows 10

from winfetch.

rashil2000 avatar rashil2000 commented on June 11, 2024

can confirm this still not solve on Windows 10

How did you install winfetch?

from winfetch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.