Good morning. How to convert list to a string where all lines separated by any keyword (in this case - [keyword]).
For example:
PS C:\> $data = dir c:\
PS C:\> $data
29.03.2023 08:53 <DIR> inetpub
29.03.2023 14:39 <DIR> Program Files
29.03.2023 09:43 <DIR> Program Files (x86)
21.02.2020 00:17 <DIR> SOLIDWORKS Data
01.04.2023 17:10 <DIR> SolidWorks_Flexnet_Server
25.03.2023 15:56 <DIR> Users
29.03.2023 14:39 <DIR> Windows
I need output like this line:
29.03.2023 08:53 <DIR> inetpub[keyword]29.03.2023 14:39 <DIR> Program Files[keyword]21.02.2020 00:17 <DIR> SOLIDWORKS Data
Also check $data for type (list or not). If the variable is a list, then only in this case is the given handler present.