I use Windows PowerShell to clear values from a third-party executable. My goal is to reinstall and simplify the output of the tool, to display only a subset of the content and allow me to collect data on many devices at the same time. I have most of the script work, but I'm stuck in a simple task that is so simple on Linux bash.
A third-party program displays the status of a computer device as standard. I can successfully set the standard content for a variable. For instance:
PS C:\> $status = mycmd.exe device1 --status
PS C:\> $status
The $ status variable will return a multi-line list of values as follows:
Device Number: 1
PCIe slot: 3
Firmware Version: 5.1.4
Temperature: 45C
State: Online
. Linux - ( ):
Firmware=$(mycmd device1 --status | grep "Firmware" | cut -c 19-24)
Powershell Select-String, :
$Firmware = $Status | select-string -Pattern "Firmware Version"
. , , Powershell, , , , . , .
, $Firmware " 5.1.4", .