I have a document that has a structured layout, such as:
Layout ID: LC-004
Name: Items 1
Description: Description of stuff
Type: Server
Equipment ID: 3sdrsqq
PPEquipment ID: PP-003
IP Address: 10.0.0.1
This is on a couple pages, I need to put all the values into an array
Here is here I'm starting from:
$file = get-content "C:\tools\Configuration.htm"
$regex = "^Layout ID:\s*(.+)"
$ID = ([regex]::Matches($file,$regex) | %{$_.value})
The result I get for $ID is Layout ID: LC-004 when all I want is LC-004
Thanks
Powershell and Regex
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.