julianchow94 / windows-screenfetch Goto Github PK
View Code? Open in Web Editor NEWPowershell port of bash/unix screenfetch.
Powershell port of bash/unix screenfetch.
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%)
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%)
'''':::::::::::: ::::::::::::::::
'''':::: ::::::::::::::::
''''::::::::::::
''''::::
screenfetch on poweshell gallery is still 1.0.2 and not fix the divided by zero error, how to get latest version of it?
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.
The correct resolution is 5120 x 2880
,but Screenfetch
show me 2560 x 2880
.
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:
'''':::::::::::: ::::::::::::::::
'''':::: ::::::::::::::::
''''::::::::::::
''''::::
I have 5 Drives (C, D, E, F, G), 2 Network Drives (P and S) and 1 DVD Drive (H).
+ $FreeDiskPercent = ($FreeDiskSizeGB / $DiskSizeGB) * 100;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], RuntimeException
+ FullyQualifiedErrorId : RuntimeException
+ $UsedDiskPercent = ($UsedDiskSizeGB / $DiskSizeGB) * 100;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], RuntimeException
+ FullyQualifiedErrorId : RuntimeException
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
Chocolatey is an awesome package manager for windows. Packaging this script up so I could simply type choco install screenfetch
would be brilliant.
With your permission, I might package it myself when I have a spare minute.
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:
'''':::::::::::: ::::::::::::::::
'''':::: ::::::::::::::::
''''::::::::::::
''''::::
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
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
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;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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%)
Display is 1366x768 but custom set to 1932x1086. Screenfetch shows 1280x1024. It picks it up wrong even once changed back to the real resolution of the monitor.
Another edit gave it a go in powershell instead of ming and this showed up. Seems to pickup my Disk drive.
https://i.imgur.com/GGg70Y1.png
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.
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.
screenfetch
on Cygwin uses this: ..,
....,,:;+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: ....::::
....::::::::::::
....:::: ::::::::::::::::
....:::::::::::: ::::::::::::::::
:::::::::::::::: ::::::::::::::::
:::::::::::::::: ::::::::::::::::
:::::::::::::::: ::::::::::::::::
:::::::::::::::: ::::::::::::::::
................ ................
:::::::::::::::: ::::::::::::::::
:::::::::::::::: ::::::::::::::::
:::::::::::::::: ::::::::::::::::
'''':::::::::::: ::::::::::::::::
'''':::: ::::::::::::::::
''''::::::::::::
''''::::
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 👍
PS version: v7.1.0-preview.2, found on https://github.com/PowerShell/PowerShell/releases
output: https://imgur.com/a/cwAhd85
source: PowerShell/PowerShell#4766
Full screenshot:
(window to the right is admin mode)
Drive X and Y are samba share over local network:
I assume that why Drive Z is not there is because of the "System Specs" lines' limit. This limit is somehow unnecessary I think.
"Attempted to divide by zero" is not reported, as the item in Gallery is maybe not up to date with master branch.
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
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?
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?
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.
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.
On my corporate laptop, I don't have admin rights.
Is there a way to make the installation ?
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:
'''':::::::::::: ::::::::::::::::
'''':::: ::::::::::::::::
Screenshot: https://imgur.com/a/zY7vJNm
PS version: v7.1.0-preview.2, found on https://github.com/PowerShell/PowerShell/releases
Resolution: System.Object[] x System.Object[] (System.Object[]Hz)
Everything else working nicely
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.