Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

Entries from 2017-03-30 to 1 day

You can't expand array[index] in a string

Context: You can expand variables in a string like: > $var = "123" > Write-Host "$var" 123 > Problem: You can’t expand array with index: > $arr = @("456", "789") > Write-Host "$arr[0]" 456 789[0] It is also ineffective to add braces: > Wri…