April 15, 2014 at 1:11 pm
I can't remember where I saw this, and can't find it now
I want the value of $cTime to be the current value of $Hourly8, namely, 10
$Hourly8 = 10
$Hour = 8
$Var = $($('$Hourly'+$Hour))
set-Variable -Name cTime -Value $("$var")
$cTime
Thanks!
April 15, 2014 at 1:56 pm
May not be what you saw, probably not, but this should do.
$Hourly8 = 10
$Hour = 8
$Var = '$Hourly'+$Hour
$cTime = Invoke-Expression -Command "$Var"
$cTime
April 16, 2014 at 6:14 am
Close enough for rock and roll
Thanks Bruce!
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy