schleep
SSChampion
Points: 12585
More actions
April 15, 2014 at 1:11 pm
#290257
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!
bruce 1565
SSCrazy
Points: 2574
April 15, 2014 at 1:56 pm
#1706238
May not be what you saw, probably not, but this should do.
$Var = '$Hourly'+$Hour
$cTime = Invoke-Expression -Command "$Var"
April 16, 2014 at 6:14 am
#1706416
Close enough for rock and roll 😀
Thanks Bruce!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply