View Single Post
Old 08-09-2007   #5 (permalink)
A. Petitjean


 
 

RE: Creating A Variable from the Value of Another

Hi Luke,

You can also try this technique :
$a="example1"
$i=10
Invoke-Expression "`$$a = $i"

Best regards,

Arnaud Petitjean
http://www.powershell-scripting.com
The french PowerShell Community

"Luke" wrote:

> I want to be able to create a variable from the value of another variable.
> For example, say that $a=example1. How could I create a variable named
> $example1 by using the data from $a?

My System SpecsSystem Spec