title: Hidden variable Password parameter - powershell 4.0
body: <p>I am creating a release definition with a powershell script to replace a file with env variables from the release definition it works but It doesn't seem to catch the password variable which is hidden in the release definition. is there a way to tell powershell to look for hidden variables?</p>
  
  <p><strong>UPDATE:</strong> Here is the script it finds all the variables in <code>$paramsFilePath</code> that are not hidden my password in In environmental variables in Release definition is hidden and the script doesn't find it. </p>
  
  <pre><code>param(
      [string]$paramsFilePath,
  
  )
  
  Write-Verbose -Verbose "Entering script Replace-SetParameters.ps1"
  Write-Verbose -Verbose ("Path to SetParametersFile: {0}" -f $paramsFilePath)
  
  # get the environment variables
  $vars = Get-ChildItem -path env:*
  
  # read in the setParameters file
  $contents = Get-Content -Path $paramsFilePath
  
  # perform a regex replacement
  $newContents = "";
  
  $contents  | % {
      $line = $_
      if ($_ -match "__(\w+)__") {
          $setting = Get-ChildItem -path env:* | ? { $_.Name -eq $Matches[1] }
          if ($setting) {
              Write-Verbose -Verbose ("Replacing key {0} with value from environment" -f $setting.Name)
              $line = $_ -replace "__(\w+)__", $setting.Value
          }
      }
      $newContents += $line + [Environment]::NewLine
  }
  
  Write-Verbose -Verbose "Overwriting SetParameters file with new values"
  Set-Content $paramsFilePath -Value $newContents
  
  
  
  Write-Verbose -Verbose "Exiting script Replace-SetParameters.ps1"
  </code></pre>