【PowerShell】ヒアドキュメントから1行ずつ取得

Powershellでヒアドキュメントから1行ずつ取得する例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#ヒアドキュメントを改行で区切り配列へ格納 $ServerList = $ServerList -split "`n" #1行ずつ表示 $ServerList[0] $ServerList[1] #行数の取得 ($ServerList | Measure-Object).Count #ヒアドキュメント $ServerList =@" SV-01 SV-02 SV-03 SV-04 SV-05 "@ |