How can I declare variables and assign values to them at run time.
Reason: I am fetching these variables values from sql server and these variable values are configurable in nature
Code which I have tried till now
   [array]$varArray = @($($ServerName),$($HostName)) 
 foreach($varname in $varArray)
        {
          $varname = "some test value"
        }
Write-Host $ServerName
Write-Host $HostName
 
     
     
    