title: Powershell Invoke-Expression seems to keep a file handle after finishing
body: <pre><code>1. Invoke-Expression 'C:\setup.exe -url="http://mywebsite.com"' | Out-Null
  2. Invoke-Expression 'C:\Tools\delcert.exe "c:\setup.exe"'
  </code></pre>
  
  <p>As you can see on line 1 I am updating my setup.exe which is successful. On the second line I am getting an error from <code>delcert.exe</code> and I think it's because the setup.exe has not been fully disposed of in line 1.</p>
  
  <p>Should <code>Out-Null</code> wait until the file is closed and there is no longer any reference to it? <strong>If I comment out line 1 then line two is successful.</strong> Additionally if I run these two commands in separate cmd windows I don't get any issues. Thoughts?</p>
  
  <p>Inside <code>delcert.exe</code> this is the code that it fails on (to give you context on what the actual problem is).</p>
  
  <pre><code>_tprintf(_TEXT("Stripping file: %s.\n"), pszFileName);
  hFile = CreateFile(pszFileName, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, NULL);
  if (INVALID_HANDLE_VALUE == hFile) {
      dwResult = GetLastError();
      _tprintf(_TEXT("CreateFile failed with error 0x%08x\n"), dwResult);
      goto cleanupAndExit;
  }
  </code></pre>