Looping through a hash, or using an array in PowerShell

后端 未结 7 1636
暗喜
暗喜 2020-12-22 21:13

I\'m using this (simplified) chunk of code to extract a set of tables from SQL Server with BCP.

$OutputDirectory = \"c:\\junk\\\"
$ServerOption =   \"-SServe         


        
7条回答
  •  粉色の甜心
    2020-12-22 21:17

    About looping through a hash:

    $Q = @{"ONE"="1";"TWO"="2";"THREE"="3"}
    $Q.GETENUMERATOR() | % { $_.VALUE }
    1
    3
    2
    
    $Q.GETENUMERATOR() | % { $_.key }
    ONE
    THREE
    TWO
    

提交回复
热议问题