Open mondash opened 3 years ago
Although Terminus doesn't affect the Powershell installation in any way except running powershell.exe
, some people point out that the error above means problems with PSModulePath:
Enter-PSSession unexpectedly terminates when a network path is specified in PSModulePath.
Unfortunately, none of the fixes you mentioned above helped me. While the original error in those examples looks similar to mine, I don't think mine is the same. As shown in the description above, when I tried to directly run Import-Module Microsoft.PowerShell.Utility
I got System.BadImageFormatException
"The module was expected to contain an assembly manifest" and not "Failed to generate proxies for remote module 'Microsoft.PowerShell.Utility'". I'll provide my PSModulePath
which confirms that I'm not using any network paths.
PS C:\Users\*****> $env:PSModulePath.split(';')
C:\Users\*****\OneDrive\Documents\WindowsPowerShell\Modules
C:\Program Files\WindowsPowerShell\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
Sounds like the module DLLs are damaged, or were added in one of the earlier paths (C:\Users\*****\OneDrive\Documents\WindowsPowerShell\Modules
), overriding the stock ones.
I think it is a bad DLL, specifically Microsoft.PowerShell.Commands.Utility
. I see several mentions of it in my CBS.log (from running sfc) referencing mismatched hashes and corrupted payloads.
I don't have any modules in C:\Users\*****\OneDrive\Documents\WindowsPowerShell\Modules
. I tried removing the additional PowerShell modules I had previously downloaded that were located in C:\Program Files\WindowsPowerShell\Modules
(even though everything was working previously) but had no luck.
I'm not sure how I would go about repairing my broken DLL (and I really would like to avoid reseting my PC if I can). I can provide my CBS.log to you through email if you think that might help.
If your PS 5.1 DLLs are damaged, you can only replace them with identical ones from another Windows machine. For PS6+, you can just reinstall PowerShell itself. Just to reiterate, none of this has anything to do with Terminus itself, which by default installs into a self-contained directory in %APPDATA% without administrative permissions.
It does look like installing this shouldn't have caused this problem. I'm not sure why installing this happened to (directly or indirectly) result in this issue. I'll see if I can replace my bad DLL with a copy from a different machine since I'm using 5.1. If I can get it working again after doing that, I'll close this issue.
I'll note again here that I also discovered that the uninstaller left me with dirty values in my registry. The explorer context menu still showed up after uninstalling, and I had to manually remove the registry entries.
Probably final update here. Unfortunately I was never able to resolve my issue with PowerShell 5.1, and since I've spent the better part of a week trying to resolve (even copying a fresh copy of the WindowsPowerShell directry from Windows 10 VM), I'm just gonna give up for now. I've installed the latest (7.1.2) version of PowerShell Core, and that seems to be working.
While I'm still not sure whether installing Terminus directly caused my problem, I still don't think I can rule it out since it would have to be a heck of a coincidence for my PowerShell to break directly after installing. Maybe one day when I want to clean up my computer I'll do a full reset and be able to use standard PowerShell again.
Moral of the story is make FREQUENT backups.
@Eugeny Thank you greatly for your assistance debugging. I'm still a bit sad I could not find a solution, but I am glad I found a workaround for now. I'll leave this issue open for you to close. There is still the bit about dirty registry entries that has not been resolved, but you'll probably just want to close this issue and make a new one for that. I wish you the best. Perhaps I'll try Terminus another time (it does look pretty cool 😎 ).
Just by looking at the error, it might be an issue with Posh-Git Module not Terminus.
C:\Program Files\WindowsPowerShell\Modules\posh-git\1.0.0\Utils.ps1
Might try uninstalling Posh-Git and reinstalling. Does Powershell work in the default Powershell.exe application?
@cjerrington PowerShell does not work in the default Powershell.exe
application.
I've already tried removing all additional modules that I had installed (posh-git, Get-ChildItemColor, oh-my-posh). I don't think this error has anything to do with posh-git though. If you take a look closer at the last error in the description of this issue, you can see the core problem that I discovered.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two weeks unless you comment. Thank you for your contributions.
After launching and opening PowerShell in Terminus after installing, I'm greeted with this list or errors. I'm still getting these errors even after uninstalling and restarting. Very unhappy ☹️ And this looked like such a cool product...
Even trying to run "clear" gives me the following error:
And running "ls" gives me this error:
I also just found out that this has left me with a dirty registry. I still have the "paste path into terminus" entry in the right click menu of my file explorer. I'm very unhappy that I tried this out at all and I could really use some help with fixing my PowerShell so I don't need to completely reinstall Windows 10.
I've tried SFC and DISM, both of which indicated that there were problems that they could not resolve.
Here's some more debug info I've aquired: