INI file parsing in PowerShell

前端 未结 7 1212
[愿得一人]
[愿得一人] 2020-11-27 05:16

I\'m parsing simple (no sections) INI file in PowerShell. Here code I\'ve came up with, is there any way to simplify it?

convertfrom-stringdata -StringData (         


        
7条回答
  •  野性不改
    2020-11-27 06:06

    nini looks like a library ... not sure for powershell

    powershell crash

    first step

    [void][system.reflection.assembly]::loadfrom("nini.dll") (refer add-type now in ps2 )
    

    after you can use it

    $iniwr = new-object nini.config.iniconfigsource("...\ODBCINST.INI") 
    
    $iniwr.Configs et boom 
    

提交回复
热议问题