I want to parse the following text file into PowerShell objects:
OBJECT Table 60000 My table 1
{
OBJECT-PROPERTIES
{
Date=09-09-16;
Time=11:27:31;
Modified=Yes;
Version List=;
}
}
OBJECT Page 60001 My Page
{
OBJECT-PROPERTIES
{
Date=09-09-16;
Time=11:28:18;
Modified=Yes;
Version List=;
}
}
The OBJECT-PROPERTIES should be properties of the PowerShell objects. I would also like the text of the object to be included in the object.
I was stating to make some regular expression, but I don't know how to parse all that information into one regular expression.
My object is far longer than 2 objects, but just for the examples sake, its only 2 objects.
Expected Output:
Object1:
Type: Table
Number: 60000
Name: "My table 1"
Date: "09-09-16"
Time: "11:28:18"
Modified: "Yes"
"Version List": ""
Object: "<All of the text in this object>"
Object2:
Type: Page
Number: 60001
Name: "My Page"
Date: "09-09-16"
Time: "11:28:18"
Modified: "Yes"
"Version List": ""
Object: "<All of the text in this object>"
