Don’t do that #2: Multiple lines to read variables

By | February 24, 2015

Don’t do that: The following code requires multiple lines to read variables.


Do that: It’s possible to read multiple variables in one line and display the name/value:
1..10 | ForEach-Object -Process {Get-Variable -Name number$_}

(or using a for loop)


previous-buttonnext-button

Leave a Reply

Your email address will not be published.