Is there a shorthand form to get variables' values with numbered scopes?

Posted by guillermooo on Stack Overflow See other posts from Stack Overflow or by guillermooo
Published on 2010-03-27T23:42:07Z Indexed on 2010/03/27 23:43 UTC
Read the original article Hit count: 198

Filed under:
|

Is there any shorter way of doing this?

& { $a = 1 ; & { $a = 2 ; & { get-variable -name a -scope 2 } } }

... like, for instance, this?:

& { $a = 1 ; & { $a = 2 ; & { $2:a } } }

© Stack Overflow or respective owner

Related posts about powershell

Related posts about variable-scope