title: Disable strict mode in a PowerShell script
body: <p>In my PowerShell profile, I have <code>Set-StrictMode -Version 2.0</code>. Unfortunately, I have some scripts (and modules) that don't work correctly with strict mode enabled.</p>
  
  <p>I've attempted to fix this by putting <code>Set-StrictMode -Off</code> at the top of the scripts, or at the top of scripts that use the misbehaving modules. Unfortunately, it doesn't seem to have any effect.</p>
  
  <p>How do I temporarily disable strict mode in PowerShell?</p>
  
  <p><strong>More detail:</strong> This specifically occurs with PsGet. See <a href="https://github.com/psget/psget/issues/57" rel="nofollow">issue 57</a>. I have <code>Set-StrictMode -Version 2.0</code> in my profile. If I attempt to use PsGet's <code>Install-Module</code> from a script, I get errors saying "Property 'Verb' cannot be found on this object."</p>
  
  <p>This occurs even if I put <code>Set-StrictMode -Off</code> at the top of the script. If I run <code>Set-StrictMode -Off</code> at the command line before running the script, I get no errors and the script works fine.</p>
  
  <p>PsGet is imported in my profile, before turning on strict mode.</p>