Goodmorning everyone.
I need help from you if possible.
I have a file with this structure that I have to process with PowerShell.
some lines of text
ID: abc
some lines of text
ROLE: manager
some lines of text
ID: def
some lines of text
ROLE: editor
some lines of text
I need to get the values of ID and ROLE … let’s say in pairs
because subsequently I will have to use these two values (ID and ROLE) in this way
C:\COMMAND abc manager
C:\COMMAND def editor
I hope I explained myself well … but I’m afraid not!
Thank you all
Thank you very much Olaf.
I am a little (a lot!) in difficulty with the English language but as soon as I have time I will definitely watch the video linked by you.
Thank you and good day
Andrew
As state in the video which @Olaf shared, there are various methods which we can convert non-structured data into PowerShell objects, so it all depends on the data what you have. However try the code below, hope it works.
Kiran,
sorry for the delay in my reply. I had some problems.
I tried your code and it worked fine !!!
You were really nice to waste time helping a stranger!
I hope one day to return the favor.