It is currently September 8th, 2024, 12:11 am

Get BIOS Release Date and format

Get help with creating, editing & fixing problems with skins
User avatar
Sh8dyDan
Posts: 47
Joined: August 22nd, 2021, 6:10 pm

Re: [SOLVED] Get BIOS Release Date and format [SOLVED]

Post by Sh8dyDan »

Thanks for the reply balala.
The output has changed with the new PowerShell command and the RegEx no longer applies.
I posted the output in a new post.
User avatar
Brian
Developer
Posts: 2725
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: [SOLVED] Get BIOS Release Date and format [SOLVED]

Post by Brian »

Sh8dyDan wrote: July 20th, 2024, 10:10 pm I posted the output in a new post.
No need for a new thread for this since it is all related.
Sh8dyDan wrote: July 20th, 2024, 9:55 pm I'm afraid I'm going to have to ask for help from you guys with some RegEx.
I'm trying but struggling with RegEx. Is RegEx101.com an option and if so what settings would select to generate an output for Rainmeter

OUTPUT STRING:

Code: Select all


ReleaseDate 
----------- 
3/26/2024 8:00:00 PM


RESULT:

Code: Select all

2024/03/26
OUTPUT STRING:

Code: Select all


Caption 
------- 
Microsoft Windows 11 Pro


RESULT:

Code: Select all

Microsoft Windows 11 Pro
You can modify the original RunCommand measure (posted by ikarus1969) to format for a date. This would require no extra substitutions. Just let powershell do it all.

Here is an example:

Code: Select all

[MeasureBIOS_Date]
Measure=Plugin
Plugin=RunCommand
Parameter=powershell.exe -NoProfile Get-Date (Get-CimInstance -ClassName Win32_BIOS).ReleaseDate -Format "yyyy/dd/MM"
State=Hide
OutputType=ANSI

[MeasureOS_Caption]
Measure=Plugin
Plugin=RunCommand
Parameter=powershell.exe -NoProfile (Get-WmiObject -Class Win32_OperatingSystem).Caption
State=Hide
OutputType=ANSI
-Brian

PS - I added the "powershell.exe" into the Parameter option to make it shorter. "-NoProfile" is there in case you (or others) print some custom stuff when loading powershell with your user profile.
User avatar
Sh8dyDan
Posts: 47
Joined: August 22nd, 2021, 6:10 pm

Re: Get BIOS Release Date and format

Post by Sh8dyDan »

Thank you Brian for the reply.

I appreciated the PowerShell code example. It illustrated to me the ability to drill into and just extract the needed info with no need for complicated substitutions.

Quick question about wmic deprecation. Does it also include WmiObject.

Not really a concern because I went ahead and converted all my commands away from wmi and WmiObject.

Thank you
User avatar
Brian
Developer
Posts: 2725
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Get BIOS Release Date and format

Post by Brian »

Sh8dyDan wrote: July 22nd, 2024, 2:15 am Quick question about wmic deprecation. Does it also include WmiObject.
I don't think so. The entry says:
Microsoft wrote: The WMIC utility is deprecated in Windows 10, version 21H1 and the 21H1 General Availability Channel release of Windows Server. This utility is superseded by Windows PowerShell for WMI. Note: This deprecation applies to only the command-line management utility. WMI itself isn't affected.

[Update - January 2024]: Currently, WMIC is a Feature on Demand (FoD) that's preinstalled by default in Windows 11, versions 23H2 and 22H2. In the next release of Windows, the WMIC FoD will be disabled by default.
So, I believe it only effects the wmic command (usually located here: C:\Windows\System32\wbem\WMIC.exe), not the powershell version.

-Brian