Automatic variable definition
hi gurus,
so not looking powershell automatic variable usage, way can automatically name variables. example, if have text file following contents,
pi=3.14159292 height=4 width=14
i need powershell script automatically define following variables in script these values
$pi=3.1415292 $height=4 $width=14
any suggestion helpful...
-pranav
$vars = get-content vars.txt $varhash = $vars | convertfrom-stringdata ($i=0;$i -lt $varhash.count;$i++) { new-variable -name ($varhash.item($i).keys) -value ($varhash.item($i)) } grant ward, a.k.a. bigteddy
Windows Server > Windows PowerShell
Comments
Post a Comment