Windows-screenFetch
Windows-screenFetch copied to clipboard
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
Same here, looks like Get-WmiObject has been deprecated in favor of Get-CimInstance with PS7+.
Good news though, it still works in Powershell 5, lol. Top is 7.1.4, bottom is 5.1


If you're still using version 1.0.2, i'd suggest switching up to the latest files that are in this repo, instead of installing the 2018 module from Powershell gallery.