title: Powershell FolderBrowserDialog behaving differently from shell to ise
body: <p>When I run the below code in Powershell ISE everything runs fine, but when I run it from Powershell Shell I get a lot of errors about icons.</p>
  <pre><code>[System.Reflection.Assembly]::LoadWithPartialName(&quot;System.windows.forms&quot;) |Out-Null
  
  $foldername = New-Object System.Windows.Forms.FolderBrowserDialog 
  $foldername.Description = &quot;Select a folder&quot;
  $foldername.rootfolder = &quot;MyComputer&quot;
  $foldername.SelectedPath = $initialDirectory
  
  if($foldername.ShowDialog() -eq &quot;OK&quot;)
  {
      $folder += $foldername.SelectedPath
  }
  
  $folder
  </code></pre>
  <p>Example of Errors:</p>
  <pre><code>2021-10-19 15:44:43,174 ERROR - 4600 Unable to get icon for location (The operation completed successfully.): C:\Users\adalton\Pictures\Camera Roll
  2021-10-19 15:44:43,176 ERROR - 4600 Unable to get icon for location (The operation completed successfully.): C:\Users\adalton\Pictures\Saved Pictures
  C:\Users\adalton\Pictures\Saved Pictures
  </code></pre>