How do I fix a broken Powershell installation?
A little bit late to the game, but recently ran into this problem. I found that my PSModulePath did not include an important path. You can view your PSModulePath by running this command:
$env:PSModulePath
To add the needed path you can run this command:
$env:PSModulePath = $env:PSModulePath + ";C:\Windows\system32\WindowsPowerShell\v1.0\Modules\"
This is a very old thread, but since I found it whilst troubleshooting the exact same issue - I thought I'd mention how I resolved it.
First the problem as I experienced it:
I had PowerShell 2.0 on Windows 7, then used choco to install/upgrade to PowerShell 4.0:
choco upgrade powershell
That updated my system to 4.0, but when I opened PowerShell, the upgrade broke most of the basic cmdlets such as Get-ChildItem (aka dir).
After fumbling about online for a while, I thought I'd reinstall from the MS Website... but first I uninstalled from choco.
choco uninstall powershell
And since it was choco that broke it to begin with I thought I'd give it one more try to install cleanly with the following command:
choco install powershell --force
And low, that fixed the problem. So I stopped there.Hopefully that's helpful to someone.Good luck!