Reputation: 1989
My INI (config.ini
) file looks like below
#this is comment
[Folder]
C:\temp
C:\dir1
C:\dir2
How can I get the content of [Folder]
using powershell?
I need the folder path in an array
The example I've seen are with name value pairs
Upvotes: 0
Views: 2031
Reputation: 60958
Using your example config.ini:
[System.Collections.ArrayList]$a = GC .\CONFIG.INI
[string[]]$b=$a.GetRange( $a.IndexOf("[Folder]")+1, ( $a.Count - ($a.IndexOf("[Folder]")+1)))
$b
C:\temp
C:\dir1
C:\dir2
Upvotes: 1