title: Setting environment variables to an empty string in PowerShell
body: <p>I'm trying to set an environment variable, in PowerShell, to an empty string. Note that I don't want to <em>unset</em> the environment variable; I want it set but empty. However, PowerShell removes the environment variable entirely if you just set it to the empty string. I've tried the following:</p>
  
  <pre><code>$ENV:VAR=''
  $ENV:VAR=[String]::Empty
  $ENV:VAR=[NullString]::Value
  $ENV:VAR=$null
  New-Item -Path ENV:VAR -Value ''
  New-Item -Path ENV:VAR -Value [string::Empty]
  </code></pre>
  
  <p>Each of those (except the last one) caused the variable not to appear in the output of <code>Get-ChildItem -path ENV:</code>. The last one set the environment variable to the literal string <code>[string::Empty]</code>, which is definitely not what I wanted.</p>
  
  <p>For completeness:</p>
  
  <blockquote>
    <p>$PSVersionTable.PSVersion</p>
  
  <pre><code>Major  Minor  Build  Revision
  -----  -----  -----  --------
  5      0      10586  117
  </code></pre>
  </blockquote>
  
  <p>I can see that it's <em>possible</em> to have an empty environment variable, because I have several:</p>
  
  <pre><code>ConEmuANSI                     ON
  ConEmuAnsiLog
  ConEmuArgs
  ConEmuArgs2
  ConEmuBackHWND                 0x00F40BFC
  </code></pre>
  
  <hr>
  
  <p>Just for reference, I'm actually trying to set the <code>DOCKER_TLS_VERIFY</code> environment variable to an empty string, because docker-compose treats the absence of that variable as indicating that I want to do TLS verification, and the Docker host I'm using has TLS disabled. I've temporarily given up and switched shells.</p>