title: Powershell: Unable to update PowerShellGet , error: The version '1.4.7' of module 'PackageManagement' is currently in use
body: <p>Win10 laptop, in service for a couple years.</p>
  <p>I have been stuck on this for a couple of days.</p>
  <p><strong>I try this command:</strong></p>
  <pre><code>Install-Module –Name PowerShellGet –Force -AllowClobber
  </code></pre>
  <p><strong>Which throws this error:</strong></p>
  <pre><code>WARNING: The version '1.4.7' of module 'PackageManagement' 
  is currently in use. Retry the operation after closing the applications.
  </code></pre>
  <p>I can see in task manager there are no other sessions of powershell running.</p>
  <p>I can exit all the sessions, and run this from a plain cmd:</p>
  <pre><code>powershell -NoProfile -Command &quot;Install-Module -Name PowerShellGet -Force -AllowClobber&quot;
  </code></pre>
  <p><strong>And I get the SAME error.</strong></p>
  <p>OK, so I exit all powershell instances (as seen in Details tab of taskmgr) and do this:</p>
  <pre><code>powershell -NoProfile -Command &quot;Uninstall-Module PowerShellGet&quot;
  powershell -NoProfile -Command &quot;Install-Module -Name PowerShellGet -Force -AllowClobber&quot;
  </code></pre>
  <p><strong>And I get the <em>same</em> error.</strong></p>
  <p>So I do the uninstall again, (which runs without messages or errors). And I take out the big guns... powershell.exe is not running, and I navigate to:</p>
  <pre><code>C:\Users\$user\Documents\WindowsPowerShell\Modules\PackageManagement\1.4.7
  </code></pre>
  <p>And I delete the 1.4.7 directory.</p>
  <p>And the commands above run with the same behavior and same error.</p>
  <p>How do I move past this?</p>
  <p><strong>Additional Background:</strong></p>
  <pre><code>PS C:\WINDOWS\system32&gt; Get-Module -ListAvailable PowerShellGet,PackageManagement
  
  
      Directory: C:\Program Files\WindowsPowerShell\Modules
  
  
  ModuleType Version    Name                                ExportedCommands
  ---------- -------    ----                                ----------------
  Script     1.4.7      PackageManagement                   {Find-Package, Get-Package, Get-PackageProvider, Get-Packa...
  Binary     1.0.0.1    PackageManagement                   {Find-Package, Get-Package, Get-PackageProvider, Get-Packa...
  Script     2.2.5      PowerShellGet                       {Find-Command, Find-DSCResource, Find-Module, Find-RoleCap...
  Script     1.0.0.1    PowerShellGet                       {Install-Module, Find-Module, Save-Module, Update-Module...}
  
  
  PS C:\WINDOWS\system32&gt;  Get-Module -ListAvailable PowerShellGet,PackageManagement | % path
  C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.4.7\PackageManagement.psd1
  C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\PackageManagement.psd1
  C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PowerShellGet.psd1
  C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PowerShellGet.psd1
  </code></pre>
  <p><strong>Also Tried</strong></p>
  <p>Limiting scope to current user:</p>
  <pre><code>PS C:\WINDOWS\system32&gt; Install-Module -Name PowerShellGet -Force -Scope CurrentUser
  WARNING: The version '1.4.7' of module 'PackageManagement' is currently in use. Retry the operation after closing the
  applications.
  PS C:\WINDOWS\system32&gt; exit
  
  # OK, check taskmgr that all powershell.exe have exited, and run the below
  C:\WINDOWS\system32&gt;powershell -command &quot;Install-Module -Name PowerShellGet -Force -Scope CurrentUser&quot;
  WARNING: The version '1.4.7' of module 'PackageManagement' is currently in use. Retry the operation after closing the
  applications.
  </code></pre>
  <p><strong>SOLUTION</strong></p>
  <p>I did not track exactly the step, but one of the comments below led to a path that did resolve.</p>
  <p>One of the tricks was to watch the process list, and to be sure that all vscode and other powershell-loading process were terminated prior to doing the update.</p>
  <p>Apologies I cannot document the exact step that resolved. (I was kind of toast working on this.)</p>