Coder Social home page Coder Social logo

windows-screenfetch's People

Contributors

andot avatar codegrammer45 avatar jakubmi9 avatar jmbeach avatar julianchow94 avatar nekuskus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

windows-screenfetch's Issues

Windows 11 (Build 22621) with Powershell 7.2.5 error

First time installation via

Install-Module -Name windows-screenfetch

the following output:

PS C:\Users\<name> screenfetch
InvalidOperation: Method invocation failed because [Deserialized.System.Management.ManagementObject#root\cimv2\Win32_OperatingSystem] does not contain a method named 'ConvertToDateTime'.

InvalidOperation: You cannot call a method on a null-valued expression.

RuntimeException: Attempted to divide by zero.

RuntimeException: Attempted to divide by zero.

Screenfetch: System Specs occupies more lines than the Ascii Art resource selected
                         ....::::       <name>@<computername>
                 ....::::::::::::       OS: Microsoft Windows 11 Pro 64-Bit
        ....:::: ::::::::::::::::       Kernel: 10.0.22621
....:::::::::::: ::::::::::::::::       Uptime:
:::::::::::::::: ::::::::::::::::       Motherboard: HP 83E1
:::::::::::::::: ::::::::::::::::       Shell: PowerShell 7.2.5
:::::::::::::::: ::::::::::::::::       Resolution:  x    x
:::::::::::::::: ::::::::::::::::       Window Manager: DWM
................ ................       Font: Segoe UI
:::::::::::::::: ::::::::::::::::       CPU: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
:::::::::::::::: ::::::::::::::::       GPU Intel(R) UHD Graphics 630
:::::::::::::::: ::::::::::::::::       RAM: 16780MB / 32542 MB (52%)
'''':::::::::::: ::::::::::::::::       Disk C: 115GB / 953GB (12%)
        '''':::: ::::::::::::::::       Disk D: 0,028000000000000025GB / 1.863GB (2%)
                 ''''::::::::::::       Disk G: -946,5GB / 1.500GB (-63.100%)
                         ''''::::       Disk I: 1,741GB / 3.072GB (57%)
                                        Disk N: -946,5GB / 1.500GB (-63.100%)
                                        Disk S: -946,5GB / 1.500GB (-63.100%)
                                        Disk X: 1,741GB / 3.072GB (57%)

Attempted to divide by zero

when I run screenfetch it displays one extra disk and gives error that it attempted to divide by zero.
image
my guess is that it's trying to display optical drive as a disk.

Screen Resolution error while executing over RDP

Used Windows 2019 Standard to test.

Get-WmiObject : Not supported
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:107 char:17
+ ... $monitors = Get-WmiObject -N "root\wmi" -Class WmiMonitorListedSuppor ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Get-WmiObject], ManagementException
    + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

                         ....::::       Administrator@WIN-64LF2MQS6TR
                 ....::::::::::::       OS: Microsoft Windows Server 2019 Standard 64-bit
        ....:::: ::::::::::::::::       Kernel: 10.0.17763
....:::::::::::: ::::::::::::::::       Uptime: 0d 0h 30m 43s
:::::::::::::::: ::::::::::::::::       Motherboard: ASUSTeK COMPUTER INC. P9X79
:::::::::::::::: ::::::::::::::::       Shell: PowerShell 5.1.17763.316
:::::::::::::::: ::::::::::::::::       Resolution: DWM
:::::::::::::::: ::::::::::::::::       Window Manager: Segoe UI
................ ................       Font: Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz
:::::::::::::::: ::::::::::::::::       CPU: Microsoft Basic Display Adapter
:::::::::::::::: ::::::::::::::::       GPU 4974MB / 16334 MB (30%)
:::::::::::::::: ::::::::::::::::       RAM: Disk C: 36GB / 167GB (22%)
'''':::::::::::: ::::::::::::::::
        '''':::: ::::::::::::::::
                 ''''::::::::::::
                         ''''::::

Error (Windows 11)

I get this error

InvalidOperation: Method invocation failed because [Deserialized.System.Management.ManagementObject#root\cimv2\Win32_OperatingSystem]
does not contain a method named 'ConvertToDateTime'.

InvalidOperation: You cannot call a method on a null-valued expression.

repackage and install with added ascii art

image

I added in my own ascii art of a Tenno symbol, and have repackaged the folder into the required .nupkg. I am trying to install it via Install-Script -Force, but it returns the error. How can I resolve this.

Doesn't support PowerShell Core

WMI commands are no more supported by PowerShell Core 6.0.
Please update your commands according to this article https://docs.microsoft.com/en-us/powershell/scripting/whats-new/breaking-changes-ps6?view=powershell-6

This is the result of executing screenfetch on PowerShell Core:

PS C:\Users\sacha> screenfetch
Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:65 char:35
+     return $env:USERNAME + "@" + (Get-WmiObject Win32_OperatingSystem ...
+                                   ~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:70 char:13
+     return (Get-WmiObject Win32_OperatingSystem).Caption + " " +
+             ~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:76 char:13
+     return (Get-WmiObject  Win32_OperatingSystem).Version;
+             ~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:81 char:17
+     $Uptime = ((Get-WmiObject Win32_OperatingSystem).ConvertToDateTim ...
+                 ~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

You cannot call a method on a null-valued expression.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:86 char:5
+     $FormattedUptime =  $Uptime.Days.ToString() + "d " + $Uptime.Hour ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:107 char:17
+     $monitors = Get-WmiObject -N "root\wmi" -Class WmiMonitorListedSu ...
+                 ~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:133 char:15
+     return (((Get-WmiObject Win32_Processor).Name) -replace '\s+', '  ...
+               ~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:138 char:13
+     return (Get-WmiObject Win32_DisplayConfiguration).DeviceName;
+             ~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:143 char:35
+     $FreeRam = ([math]::Truncate((Get-WmiObject Win32_OperatingSystem ...
+                                   ~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:144 char:36
+     $TotalRam = ([math]::Truncate((Get-WmiObject Win32_ComputerSystem ...
+                                    ~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Attempted to divide by zero.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:146 char:5
+     $FreeRamPercent = ($FreeRam / $TotalRam) * 100;
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], RuntimeException
+ FullyQualifiedErrorId : RuntimeException

Attempted to divide by zero.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:148 char:5
+     $UsedRamPercent = ($UsedRam / $TotalRam) * 100;
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], RuntimeException
+ FullyQualifiedErrorId : RuntimeException

You cannot call a method on a null-valued expression.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:151 char:12
+     return $UsedRam.ToString() + "MB / " + $TotalRam.ToString() + " M ...
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:158 char:18
+     $NumDisks = (Get-WmiObject Win32_LogicalDisk).Count;
+                  ~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:189 char:20
+         $DiskID = (Get-WmiObject Win32_LogicalDisk).DeviceId;
+                    ~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:191 char:26
+         $FreeDiskSize = (Get-WmiObject Win32_LogicalDisk).FreeSpace
+                          ~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:195 char:22
+         $DiskSize = (Get-WmiObject Win32_LogicalDisk).Size;
+                      ~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

You cannot call a method on a null-valued expression.
At C:\Users\sacha\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:215 char:13
+             $FormattedDisk = "Disk " + $DiskID.ToString() + " Empty";
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

                         ....::::
                 ....::::::::::::       OS: Microsoft Corporation Surface Book
        ....:::: ::::::::::::::::       Kernel: PowerShell 6.1.1
....:::::::::::: ::::::::::::::::       Uptime: DWM
:::::::::::::::: ::::::::::::::::       Motherboard: Segoe UI
:::::::::::::::: ::::::::::::::::       Shell:
:::::::::::::::: ::::::::::::::::       Resolution:
:::::::::::::::: ::::::::::::::::       Window Manager:
................ ................       Font:
:::::::::::::::: ::::::::::::::::       CPU:
:::::::::::::::: ::::::::::::::::       GPU
:::::::::::::::: ::::::::::::::::       RAM:
'''':::::::::::: ::::::::::::::::
        '''':::: ::::::::::::::::
                 ''''::::::::::::
                         ''''::::

Wrong information for disks

I have 5 Drives (C, D, E, F, G), 2 Network Drives (P and S) and 1 DVD Drive (H).

2017-09-23_12-16-09

  • DVD-Drive H: is in the list, has 0GB/0GB and 51% used storage. Because of the empty space and dividing through zero the script throws exceptions at Line 152 and 156 of SystemInfoCollector.psm1:
+         $FreeDiskPercent = ($FreeDiskSizeGB / $DiskSizeGB) * 100;
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException
+         $UsedDiskPercent = ($UsedDiskSizeGB / $DiskSizeGB) * 100;
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException
  • Disk D and E have both negative amount of used space and a negative usage percentage
  • only one of the two Network Drives is listed
  • the following exception is thrown in screenfetch.ps1:
System Specs occupies more lines than the Ascii Art resource selected
In Zeile:1 Zeichen:1
+ screenfetch
+ ~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,screenfetch.ps1

error after execution

Screenfetch
Get-WmiObject: The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.

Get-WmiObject: The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.

Get-WmiObject: The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.

Get-WmiObject: The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.

InvalidOperation: You cannot call a method on a null-valued expression.

Get-WmiObject: The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.

Get-WmiObject: The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.

Get-WmiObject: The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.

Get-WmiObject: The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.

Get-WmiObject: The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.

RuntimeException: Attempted to divide by zero.

RuntimeException: Attempted to divide by zero.

InvalidOperation: You cannot call a method on a null-valued expression.

Get-WmiObject: The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.

Get-WmiObject: The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.

Get-WmiObject: The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.

Get-WmiObject: The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.

InvalidOperation: You cannot call a method on a null-valued expression.

                     ....::::
             ....::::::::::::       OS: Hewlett-Packard 2246
    ....:::: ::::::::::::::::       Kernel: PowerShell 7.2.1

....:::::::::::: :::::::::::::::: Uptime: DWM
:::::::::::::::: :::::::::::::::: Motherboard: Segoe UI
:::::::::::::::: :::::::::::::::: Shell:
:::::::::::::::: :::::::::::::::: Resolution:
:::::::::::::::: :::::::::::::::: Window Manager:
................ ................ Font:
:::::::::::::::: :::::::::::::::: CPU:
:::::::::::::::: :::::::::::::::: GPU
:::::::::::::::: :::::::::::::::: RAM:
'''':::::::::::: ::::::::::::::::
'''':::: ::::::::::::::::
''''::::::::::::
''''::::

Monitor resolution requires elevated prompt

Get-WmiObject : Access denied
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:107 char:17
+ ... $monitors = Get-WmiObject -N "root\wmi" -Class WmiMonitorListedSuppor ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Get-WmiObject], ManagementException
    + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

occurs in Terminal or PowerShell when not in an elevated state.
Monitor resolution is missing as a result as well causing results to shift up a row:

Font: AMD Ryzen 7 2700X Eight-Core Processor
CPU: Radeon (TM) RX 480 Graphics
GPU 8357MB / 32675 MB (26%)

etc

Errors Message

A lot of error message blows up after running screenfetch command.
Screenshot (183)
Screenshot (184)
Screenshot (185)
Why is that ?

Tons of error messages on pwsh 7.1.4

Get-WmiObject: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:65
Line |
  65 |      return $env:USERNAME + "@" + (Get-WmiObject Win32_OperatingSystem …
     |                                    ~~~~~~~~~~~~~
     | The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct
     | and try again.

Get-WmiObject: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:70
Line |
  70 |      return (Get-WmiObject Win32_OperatingSystem).Caption + " " +
     |              ~~~~~~~~~~~~~
     | The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct
     | and try again.

Get-WmiObject: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:76
Line |
  76 |      return (Get-WmiObject  Win32_OperatingSystem).Version;
     |              ~~~~~~~~~~~~~
     | The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct
     | and try again.

Get-WmiObject: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:81
Line |
  81 |      $Uptime = ((Get-WmiObject Win32_OperatingSystem).ConvertToDateTim …
     |                  ~~~~~~~~~~~~~
     | The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct
     | and try again.

InvalidOperation: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:86
Line |
  86 |      $FormattedUptime =  $Uptime.Days.ToString() + "d " + $Uptime.Hour|      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.

Get-WmiObject: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:107
Line |
 107 |      $monitors = Get-WmiObject -N "root\wmi" -Class WmiMonitorListedSu …
     |                  ~~~~~~~~~~~~~
     | The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct
     | and try again.

Get-WmiObject: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:133
Line |
 133 |      return (((Get-WmiObject Win32_Processor).Name) -replace '\s+', '
     |                ~~~~~~~~~~~~~
     | The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct
     | and try again.

Get-WmiObject: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:138
Line |
 138 |      return (Get-WmiObject Win32_DisplayConfiguration).DeviceName;
     |              ~~~~~~~~~~~~~
     | The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct
     | and try again.

Get-WmiObject: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:143
Line |
 143 |      $FreeRam = ([math]::Truncate((Get-WmiObject Win32_OperatingSystem …
     |                                    ~~~~~~~~~~~~~
     | The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct
     | and try again.

Get-WmiObject: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:144
Line |
 144 |      $TotalRam = ([math]::Truncate((Get-WmiObject Win32_ComputerSystem …
     |                                     ~~~~~~~~~~~~~
     | The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct
     | and try again.

RuntimeException: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:146
Line |
 146 |      $FreeRamPercent = ($FreeRam / $TotalRam) * 100;
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Attempted to divide by zero.

RuntimeException: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:148
Line |
 148 |      $UsedRamPercent = ($UsedRam / $TotalRam) * 100;
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Attempted to divide by zero.

InvalidOperation: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:151
Line |
 151 |      return $UsedRam.ToString() + "MB / " + $TotalRam.ToString() + " M …
     |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.

Get-WmiObject: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:158
Line |
 158 |      $NumDisks = (Get-WmiObject Win32_LogicalDisk).Count;
     |                   ~~~~~~~~~~~~~
     | The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct
     | and try again.

Get-WmiObject: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:189
Line |
 189 |          $DiskID = (Get-WmiObject Win32_LogicalDisk).DeviceId;
     |                     ~~~~~~~~~~~~~
     | The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct
     | and try again.

Get-WmiObject: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:191
Line |
 191 |          $FreeDiskSize = (Get-WmiObject Win32_LogicalDisk).FreeSpace
     |                           ~~~~~~~~~~~~~
     | The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct
     | and try again.

Get-WmiObject: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:195
Line |
 195 |          $DiskSize = (Get-WmiObject Win32_LogicalDisk).Size;
     |                       ~~~~~~~~~~~~~
     | The term 'Get-WmiObject' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct
     | and try again.

InvalidOperation: C:\Users\marti\Documents\PowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:215
Line |
 215 |              $FormattedDisk = "Disk " + $DiskID.ToString() + " Empty";
     |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.

                         ....::::
                 ....::::::::::::       OS: ASUSTeK COMPUTER INC. PRIME B450M-GAMING/BR
        ....:::: ::::::::::::::::       Kernel: PowerShell 7.1.4
....:::::::::::: ::::::::::::::::       Uptime: DWM
:::::::::::::::: ::::::::::::::::       Motherboard: Segoe UI
:::::::::::::::: ::::::::::::::::       Shell:
:::::::::::::::: ::::::::::::::::       Resolution:
:::::::::::::::: ::::::::::::::::       Window Manager:
................ ................       Font:
:::::::::::::::: ::::::::::::::::       CPU:
:::::::::::::::: ::::::::::::::::       GPU
:::::::::::::::: ::::::::::::::::       RAM:
'''':::::::::::: ::::::::::::::::
        '''':::: ::::::::::::::::
                 ''''::::::::::::
                         ''''::::

A lot of information is also not shown at the end.
I'm using Windows Terminal got the script through the Install-Module command as recommended
Seems like it's some issue with the Get-WmiObject function, quick googling suggests it might be deprecated

Wrong screen resolution

My monitor has Full HD resolution, but the script does not detect it correctly. I'm running it on Windows 10 1709 (16299.64). I tried to execute the script with the usual privileges and on behalf of the administrator, this does not change the situation. What can be done about this?
3

Error: dividing by 0

error

Hi, there seems to be an issue with calculating used disk percentage used from my D drive (CD-Rom) and I'm not quite sure how to fix it myself.

Error in windows 11

Cannot convert value "4 343" to type "System.Int32". Error: "Indatasträngen hade ett felaktigt format."
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:174 char:13

  •         $FreeDiskPercent = ($FreeDiskSizeGB / $DiskSizeGB) * 100;
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvalidCastFromStringToInteger

Cannot convert value "7 452" to type "System.Int32". Error: "Indatasträngen hade ett felaktigt format."
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:177 char:13

  •         $UsedDiskSizeGB = $DiskSizeGB - $FreeDiskSizeGB;
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvalidCastFromStringToInteger

Cannot convert value "7 452" to type "System.Int32". Error: "Indatasträngen hade ett felaktigt format."
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:178 char:13

  •         $UsedDiskPercent = ($UsedDiskSizeGB / $DiskSizeGB) * 100;
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [], RuntimeException

    • FullyQualifiedErrorId : InvalidCastFromStringToInteger

                     ....::::       Simon@DESKTOP-U1C2EP4
             ....::::::::::::       OS: Microsoft Windows 11 Enterprise 64 bitar
      

      ....:::: :::::::::::::::: Kernel: 10.0.22000
      ....:::::::::::: :::::::::::::::: Uptime: 0d 0h 10m 5s
      :::::::::::::::: :::::::::::::::: Motherboard: ASUSTeK COMPUTER INC. ROG STRIX B550-F GAMING
      :::::::::::::::: :::::::::::::::: Shell: PowerShell 5.1.22000.65
      :::::::::::::::: :::::::::::::::: Resolution: 2560 x 1440 1920 x 1080
      :::::::::::::::: :::::::::::::::: Window Manager: DWM
      ................ ................ Font: Segoe UI
      :::::::::::::::: :::::::::::::::: CPU: AMD Ryzen 5 5600X 6-Core Processor
      :::::::::::::::: :::::::::::::::: GPU NVIDIA GeForce GTX 1060 6GB
      :::::::::::::::: :::::::::::::::: RAM: 10325MB / 32682 MB (32%)
      '''':::::::::::: :::::::::::::::: Disk C: 371GB / 931GB (40%)
      '''':::: :::::::::::::::: Disk D: 0GB / 238GB (0%)
      '''':::::::::::: Disk E: 0GB / 7 452GB (0%)
      '''':::: Disk F: 83GB / 466GB (18%)

Command doesn't run

Installed with "Install-Module -Name windows-screenfetch", no error given, attempting to run with screenfetch or windows-screenfetch. No good.

image

Zero-sized disks cause divide by zero exception

For whatever reason, I have disks or partitions with no space on them, such as drives created by Daemon Tools Lite to mount ISO files.

This causes a divide by zero exception when trying to calculate disk usage in Data.psm1.

Attempted to divide by zero

Attempted to divide by zero.
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:174 char:13
+             $FreeDiskPercent = ($FreeDiskSizeGB / $DiskSizeGB) * 100;
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

Attempted to divide by zero.
At C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:178 char:13
+             $UsedDiskPercent = ($UsedDiskSizeGB / $DiskSizeGB) * 100;
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

I encounter these errors. May be script try to calculate the empty zero disk.

Better Ascii art

screenfetch on Cygwin uses this:

scrf-w10

                                  .., 
                      ....,,:;+ccllll 
        ...,,+:;  cllllllllllllllllll 
  ,cclllllllllll  lllllllllllllllllll 
  llllllllllllll  lllllllllllllllllll 
  llllllllllllll  lllllllllllllllllll 
  llllllllllllll  lllllllllllllllllll 
  llllllllllllll  lllllllllllllllllll 
  llllllllllllll  lllllllllllllllllll 
                                      
  llllllllllllll  lllllllllllllllllll 
  llllllllllllll  lllllllllllllllllll 
  llllllllllllll  lllllllllllllllllll 
  llllllllllllll  lllllllllllllllllll
  llllllllllllll  lllllllllllllllllll
  `'ccllllllllll  lllllllllllllllllll
         `'""*::  :ccllllllllllllllll
                        ````''"*::cll
                                   ``

Windows-screenFetch uses this:

wscrf

                         ....::::
                 ....::::::::::::
        ....:::: ::::::::::::::::
....:::::::::::: ::::::::::::::::
:::::::::::::::: ::::::::::::::::
:::::::::::::::: ::::::::::::::::
:::::::::::::::: ::::::::::::::::
:::::::::::::::: ::::::::::::::::
................ ................
:::::::::::::::: ::::::::::::::::
:::::::::::::::: ::::::::::::::::
:::::::::::::::: ::::::::::::::::
'''':::::::::::: ::::::::::::::::
        '''':::: ::::::::::::::::
                 ''''::::::::::::
                         ''''::::
                                 

I think the first one looks better. If you also agree, I'd appreciate updating the ascii art :)
Also, thanks for creating this awesome powershell tool 👍

Continues the error of dividing by zero

Install the module but when executing it it reads the disk F which is to read CDs, it marks the disk with zero Gb therefore it tries to divide by zero which marks as an error although it works
image

Get my fork for better performance (shameless plug)

This repo seems abandoned, check out my fork to get 15x the performance and a PowerShell module with the latest commits.

You can also just install it if you want:

Install-Module -Name windows-screenfetch-fast

You will have to uninstall the original since both use screenfetch: Uninstall-Module -Name windows-screenfetch

Why is Powershell Gallery not updated?

I just worked on this package locally since I want to use it with both PowerShell 5 and PowerShell Core 7 (and I thought it might be a good practice with PowerShell scripting).
Then I come here to see if I actually might contribute just to notice that the package on PowerShell Gallery is very outdated. A git fetch says me it is 23 commits behind master and cheking on the gallery I see this:
1.0.2 (current version) | 22,840 | 2/20/2018

Why is that?

[Suggestion] Windows 7 logo/distro argument

It's possible to install the Windows Management Framework 5.1 on Windows 7 and that lets you run screenfetch, but the logo is out of place. Is there a chance you could put the Windows 7 logo in the art?

Windows window manager is implenented in win32k.sys, not dwm.exe

Following line is wrong:

Window Manager: DWM

dwm.exe is only compositing engine, something like SurfaceFlinger in Android. All window logic and behavior is handled in win32k.sys and user32.dll. Windows can work after killing dwm.exe, only applications that directly use DWM API will be broken.

Improve Performance

Not sure if, or how difficult it would be to improve performance, but this command seems to take 8+ seconds. Where I'm able to use neofetch at the end of my WSL/Linux bashrc to display with each prompt, I cannot reasonably do this with powershell or git bash as it just takes too long to run.

Does not run properly on Powershell 7.0.1

On PowerShell 7.0.1 trying to run screenfetch gives me a faulty output whereas it works smoothly in PowerShell 5.1:

Get-WmiObject: C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:195
Line |
 195 |          $DiskSize = (Get-WmiObject Win32_LogicalDisk).Size;
     |                       ~~~~~~~~~~~~~
     | The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct
     | and try again.

InvalidOperation: C:\Program Files\WindowsPowerShell\Modules\windows-screenfetch\1.0.2\Data.psm1:215
Line |
 215 |              $FormattedDisk = "Disk " + $DiskID.ToString() + " Empty";
     |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.

                         ....::::
                 ....::::::::::::       OS: Dell Inc. 0N7TVV
        ....:::: ::::::::::::::::       Kernel: PowerShell 7.0.1
....:::::::::::: ::::::::::::::::       Uptime: DWM
:::::::::::::::: ::::::::::::::::       Motherboard: Segoe UI
:::::::::::::::: ::::::::::::::::       Shell:
:::::::::::::::: ::::::::::::::::       Resolution:
:::::::::::::::: ::::::::::::::::       Window Manager:
................ ................       Font:
:::::::::::::::: ::::::::::::::::       CPU:
:::::::::::::::: ::::::::::::::::       GPU
:::::::::::::::: ::::::::::::::::       RAM:
'''':::::::::::: ::::::::::::::::
        '''':::: ::::::::::::::::

Command conflict 'Get-Uptime'

When I run Install-Module -Name windows-screenfetch on PowerShell 7.0.1, it gives me an error:

Install-Package: D:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:9709                                 Line |                                                                                                                  9709 |  … talledPackages = PackageManagement\Install-Package @PSBoundParameters                                             |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                              | The following commands are already available on this system:'Get-Uptime'. This module                                 | 'windows-screenfetch' may override the existing commands. If you still want to install this module
     | 'windows-screenfetch', use -AllowClobber parameter.

The output of Get-Command Get-Uptime is

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Cmdlet          Get-Uptime                                         7.0.0.0    Microsoft.PowerShell.Utility

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.