I’ve been trying to get ChatGPT to write this but it never seems to work the way I want. I have a variable that has this data inside of it.
Caption :
Description :
ElementName :
CommunicationStatus :
DetailedStatus :
HealthState :
InstallDate :
Name : Main System Chassis
OperatingStatus :
OperationalStatus :
PrimaryStatus :
Status :
StatusDescriptions :
CanBeFRUed : False
CreationClassName : DCIM_Chassis
ManufactureDate : 7/8/2022 5:00:00 PM
Manufacturer : Dell Inc.
Model : Precision 7770
OtherIdentifyingInfo :
PartNumber : N/A
PoweredOn :
SerialNumber : N/A
SKU : N/A
Tag : CXXGTQ3
UserTracking :
VendorEquipmentType :
Version :
Depth :
Height :
HotSwappable :
OtherPackageType :
PackageType : 3
Removable :
RemovalConditions : 2
Replaceable :
VendorCompatibilityStrings :
Weight :
Width :
AudibleAlarm :
BreachDescription : Chassis cover was opened
CableManagementStrategy :
IsLocked :
LockPresent : False
SecurityBreach : 5
ServiceDescriptions :
ServicePhilosophy :
VisibleAlarm :
ChassisPackageType : 10
ChassisTypeDescription :
ChassisTypes :
CurrentRequiredOrProduced :
HeatGeneration :
InputCurrentType :
InputVoltage :
MultipleSystemSupport :
NumberOfPowerCords :
OtherInputCurrentType :
RackMountable :
TypeDescriptions :
FirstPowerOnDate : 1/24/2023 4:00:00 PM
PropertyOwnershipTag :
PSComputerName :
Caption :
Description :
ElementName : Docking Station
CommunicationStatus :
DetailedStatus :
HealthState :
InstallDate :
Name : WD22TB4
OperatingStatus :
OperationalStatus :
PrimaryStatus :
Status :
StatusDescriptions :
CanBeFRUed :
CreationClassName : DCIM_DockingStation
ManufactureDate :
Manufacturer : Dell Inc.
Model : CABLE_ID_130W_TBT4
OtherIdentifyingInfo :
PartNumber :
PoweredOn :
SerialNumber : 218-84-125-1-19-39-11-0
SKU :
Tag : 27YGHV3
UserTracking :
VendorEquipmentType :
Version : 01.00.25.01
Depth :
Height :
HotSwappable :
OtherPackageType :
PackageType : 1
Removable :
RemovalConditions : 2
Replaceable :
VendorCompatibilityStrings : {DCIM:Docking Station}
Weight :
Width :
AudibleAlarm :
BreachDescription :
CableManagementStrategy :
IsLocked :
LockPresent :
SecurityBreach :
ServiceDescriptions :
ServicePhilosophy :
VisibleAlarm :
ChassisPackageType : 12
ChassisTypeDescription : Docking Station
ChassisTypes :
CurrentRequiredOrProduced :
HeatGeneration :
InputCurrentType :
InputVoltage :
MultipleSystemSupport :
NumberOfPowerCords :
OtherInputCurrentType :
RackMountable :
TypeDescriptions :
FirstPowerOnDate :
PropertyOwnershipTag :
PSComputerName :
There are 2 lines that begin with the word VERSION. I only want the line that has data next to it.
Version : 01.00.25.01
and I really only want that number After the colon. 01.00.25.01
Now, I have this working perfectly but using .TXT files. i.e. output-file and then get-content but I wanted to make it very clean and use only variables and/or an array. It has turned out to be very tricky.
Any help would be nice.