Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wslfetch prints errors with powershell 7.3 #275

Closed
1 task done
tranzystorekk opened this issue Apr 20, 2023 · 6 comments
Closed
1 task done

wslfetch prints errors with powershell 7.3 #275

tranzystorekk opened this issue Apr 20, 2023 · 6 comments
Assignees
Labels
Bug This is either an issue that describes a bug or a PR that resolves a bug Question: Answered This question is answered in the FAQ page in the WSL Utilities Wiki

Comments

@tranzystorekk
Copy link
Contributor

Windows Version

Windows 11

Windows Build Number

22621.1555

WSL Version

WSL 2

Distro Version

Void Linux

WSL Utilities Version

4.1.1

Describe the bug

When running wslfetch, there are errors reported:

~wslfetch
gcim : Określona klasa nie istnieje.
At line:1 char:150
+ ... coding(852); [int64]((get-date) - (gcim Win32_OperatingSystem).LastBo ...
+                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : MetadataError: (root\cimv2:Win32_OperatingSystem:String) [Get-CimInstance], CimException
    + FullyQualifiedErrorId : HRESULT 0x80041010,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand

Cannot find an overload for "op_Subtraction" and the argument count: "2".
At line:1 char:128
+ ... oding(852); [int64]((get-date) - (gcim Win32_OperatingSystem).LastBoo ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodException
    + FullyQualifiedErrorId : MethodCountCouldNotFindBest

 /$$      /$$  /$$$$$$  /$$       Windows Subsystem for Linux (WSL2)
| $$  /$ | $$ /$$__  $$| $$       devuser@DESKTOP-0QOMDS0
| $$ /$$$| $$| $$  \__/| $$       Build: 22621
| $$/$$ $$ $$|  $$$$$$ | $$       Branch: ni_release
| $$$$_  $$$$ \____  $$| $$       Release: Void Linux
| $$$/ \  $$$ /$$  \ $$| $$       Kernel: Linux 5.15.90.1-microsoft-standard-WSL2
| $$/   \  $$|  $$$$$$/| $$$$$$$$ Uptime (Windows): 0d 0h 0m
|__/     \__/ \______/ |________/

Steps to Reproduce

Run wslfetch

Expected behavior

No errors, complete and valid fetch info is provided

Additional context

Verified with Powershell 7.3.3 and 7.3.4

Code of Conduct

  • I agree to follow this project's Code of Conduct
@tranzystorekk tranzystorekk added the Bug This is either an issue that describes a bug or a PR that resolves a bug label Apr 20, 2023
@tranzystorekk
Copy link
Contributor Author

tranzystorekk commented Apr 21, 2023

Inspecting wslsys seems to point towards the get_windows_uptime() and get_win_system_type() functions failing on my system

@patrick330602
Copy link
Member

Can you try to type gcim Win32_OperatingSystem in your Powershell Core and post the result?

@tranzystorekk
Copy link
Contributor Author

~gcim Win32_OperatingSystem
Get-CimInstance: Invalid class

@patrick330602
Copy link
Member

This seems to be a issue on your side: https://techcommunity.microsoft.com/t5/ask-the-performance-team/wmi-missing-or-failing-wmi-providers-or-invalid-wmi-class/ba-p/375485

this WMI class should exist on Windows

@tranzystorekk
Copy link
Contributor Author

had some time to look at this, doing (in an elevated shell instance):

net stop winmgmt
winmgmt /resetrepository

worked for me

@patrick330602
Copy link
Member

I will include this in the F&Q for ref for people in the future

@patrick330602 patrick330602 added the Question: To be included This question is answered, but not yet included in the FAQ page in the WSL Utilities Wiki label May 16, 2023
@patrick330602 patrick330602 added Question: Answered This question is answered in the FAQ page in the WSL Utilities Wiki and removed Question: To be included This question is answered, but not yet included in the FAQ page in the WSL Utilities Wiki labels Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is either an issue that describes a bug or a PR that resolves a bug Question: Answered This question is answered in the FAQ page in the WSL Utilities Wiki
Projects
None yet
Development

No branches or pull requests

2 participants