JonnyBoy
JonnyBoy

Reputation: 417

PowerShell PackageManagement not found

I'm trying to avoid having to restore my PC and get it back to where I was. I was recently going to delete a folder using Shift+Del, but without paying too close attention I hit Shift+Del on the modules folder in C:\ProgramFiles\WindowsPowerShell\Modules.

I had re-imported PowerShellGet, PackageManagement, as well as Pester.

I thought I was in the clear but I keep running into issues, I have to always Re-Import PowershellGet. Then I get another error.

Get-PSRepository : The term 'PackageManagement\Get-PackageSource' is not recognized as the name of a cmdlet, function, script file.

Even after doing Import-PackageManagement I still get that error.

If I do (Get-Module -List Available -Name PackageManagement).Exportedcmdlets it shows that Get-PackageSource is there.

I'm really not sure what I need to do to fix this.

I have uninstalled and reintalled WMF 5.1, but the issue persists.

I am running Windows 8.1

Upvotes: 2

Views: 4842

Answers (2)

JonnyBoy
JonnyBoy

Reputation: 417

The issue seems to be with PackageManagement, 1.1.4.0. I deleted that reimported PackageManagement based on what i read here. https://github.com/OneGet/oneget/issues/195

It seems to be working now.

Upvotes: 1

G42
G42

Reputation: 10019

PowerShell is an open source project. You can download the modules from github. That link also describes how to get from PowerShell Gallery, which may work for you.

Upvotes: 1

Related Questions