Comments (19)
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.
sure @rashil2000 , could you explain how do i download the modified code? sorry i'm not too practical yet with PRs and things
https://i.imgur.com/zaOWyBQ.png
from winfetch.
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.
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.
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.
@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.
I don't know for sure, on top of my head. Let me know if it occurs again
from winfetch.
What's the behaviour when we type choco list -l
in Chocolatey v2?
from winfetch.
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.
I'm using chocolatey 2.0.0 and I don't have clist command in path.
from winfetch.
because it doesn't exist anymore
from winfetch.
this has been fixed in april just never pushed to scoop etc.
from winfetch.
Do I have to fix the source code manually until the new version is pushed?
from winfetch.
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.
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.
It would be helpful if y'all could help test PR #191
from winfetch.
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.
can confirm this still not solve on Windows 10
from winfetch.
can confirm this still not solve on Windows 10
How did you install winfetch?
from winfetch.
Related Issues (20)
- Winfetch fails install HOT 4
- Non-Ascii is fucked HOT 3
- `get_percent_bar $percentage`: Cannot validate argument on parameter 'percent' HOT 11
- CPU Usage keep showing 0% HOT 1
- No longer works HOT 2
- CmdletBinding error on line 70 (Windows 10/11) HOT 5
- Issue with clist command, line 875 HOT 8
- Help with the weather info HOT 1
- Support better image display HOT 1
- Weather - Show Emojis HOT 2
- Add Localization configuration HOT 3
- Weather retrieval hangs for minutes HOT 1
- Neofetch faster than winfetch with default settings HOT 3
- Terminal info is incorrect when installed with scoop and run under wezterm terminal and git bash shell HOT 3
- Shell info is incorrect when run under cmd or git bash HOT 1
- Color in ascii art $CustomAscii HOT 2
- [BUG]: `$image` variable not working correctly. HOT 3
- Add weather location option HOT 1
- How to Install on Windows 11? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from winfetch.