title: Combine outputs in Powershell
body: <p>I currently have this script that checks the registry and if the key exists then it will output a value to the console.
  How can I modify this script so that it saves each output to a variable and then that variable will be exported to a text/csv file?</p>
  
  <pre><code>if ((Get-ItemPropertyValue -Path "HKLM:\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE" -Name HelpPane.exe) -eq '1')
  {
      Write-Output 'Yes'
  } 
  else 
  {
      Write-Output 'No'
  }
  
  if ((Get-ItemPropertyValue -Path "HKLM:\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_DISABLE_SQM_UPLOAD_FOR_APP" -Name iexplore.exe) -eq '1')
  {
      Write-Output 'Yes'
  } 
  else 
  {
      Write-Output 'No'
  }
  
  if ($Host.Name -eq "ConsoleHost")
  {
      Write-Host "Press any key to continue..."
      $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp") &gt; $null
  </code></pre>