title: Powershell: Loop through existing variables to make certain ones invisible
body: <p>My dilemma is I want to go through all my powershell variables, and for certain ones make them invisible. I'm trying to avoid writing the code for each individual variable as there are quite a few of them.</p>
  
  <p>This is what I've come up with so far, and it doesn't work and hoping for a little help.</p>
  
  <pre><code>    $var=Get-Variable | Where-Object {($_.name -like "*label*")} | Sleect -expand Name
      foreach ($y in $var) {
      $tes="`$$y"
      $tes.Visiable=$false
      }
  </code></pre>
  
  <p>In essence, I want the "$tes" to be replaced with the actual variable name, "$labelHome" so the command would run as if I had entered "$labelHome.Visible=$false"</p>
  
  <p>Thanks</p>