Repository navigation
Powershell Framework is broken (again) under Powershell Core #18108
Copy link
Copy link
Closed as duplicate
Labels
Resolution-DuplicateThe issue is a duplicate.The issue is a duplicate.
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
C:\Users\keith.russell>pwsh
PowerShell 7.2.1
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
A new PowerShell stable release is available: v7.2.6
Upgrade now, or check out the release page at:
https://aka.ms/PowerShell-Release?tag=v7.2.6
PS C:\Users\keith.russell> cmd
Microsoft Windows [Version 10.0.19044.1889]
(c) Microsoft Corporation. All rights reserved.
C:\Users\keith.russell>powershell
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\Users\keith.russell> get-filehash
get-filehash : The term 'get-filehash' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
### Expected behavior
```console
C:\Users\keith.russell>pwsh
PowerShell 7.2.1
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
A new PowerShell stable release is available: v7.2.6
Upgrade now, or check out the release page at:
https://aka.ms/PowerShell-Release?tag=v7.2.6
PS C:\Users\keith.russell> cmd
Microsoft Windows [Version 10.0.19044.1889]
(c) Microsoft Corporation. All rights reserved.
C:\Users\keith.russell>powershell
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\Users\keith.russell> get-filehash
get-filehash : The term 'get-filehash' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Actual behavior
PS C:\Users\keith.russell> get-filehash
cmdlet Get-FileHash at command pipeline position 1
Supply values for the following parameters:
Path[0]:Error details
get-filehash : The term 'get-filehash' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ get-filehash
+ ~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (get-filehash:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundExceptionEnvironment data
PS C:\Users\keith.russell> $PSVersionTable
Name Value
---- -----
PSVersion 7.2.1
PSEdition Core
GitCommitId 7.2.1
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Resolution-DuplicateThe issue is a duplicate.The issue is a duplicate.
Activity
AssortedBits commentedon Sep 16, 2022
NOTICE THE
cmd.exeLAYER SANDWICHED IN THE MIDDLE. THIS IS NECESSARY TO MANIFEST THE BUG.iSazonov commentedon Sep 16, 2022
Please re-check with latest 7.2.6 version and latest 7.3 Preview.
jhoneill commentedon Sep 16, 2022
Ilya (@iSazonov) just tried it, it repos on both.
What's odd is
Get-FileHashhas gone missing. It's there in Pwsh and PowerShell.exe normally, but not if one follows the stepsdkaszews commentedon Sep 16, 2022
That looks like a fun bug. Does
Get-FileHashdepend on some environment implementation likeGet/Set-Clipboardonxclip? Maybe putting cmd in the middle causes the environment variables to get messed up?iSazonov commentedon Sep 16, 2022
Get-FileHashid binary cmdlet in pwsh and script in Windows PowerShell. This says WinPS doesn't load Microsoft.PowerShell.Utility module in right way.Root of the issue both PowerShell modify PSModule environment variable to insert version specific paths.
Obviously, this leads to conflict. While pwsh uses tricks to fix this WinPS knows nothing about it and works the same old way. Also pwsh cannot apply its tricks if it do not call WinPS directly.
There have already been a few PRs made around this. Each time with different tricky bugs. There will probably be more attempts until a move is made to eliminate the conflict at the root.
My suggestion was to abandon this practice (modify PSModule), but MSFT team says it will break some scenarios, but doesn't say which ones - apparently it's their big secret :-)
kilasuit commentedon Sep 24, 2022
Seems the Issue template managed to get broken on this issue
tusharsnx commentedon May 12, 2023
As a workaround, you can import WinPS compatible 'Microsoft.PowerShell.Utility' which contains 'Get-FileHash' function:
This can be run at the top of the script.
nannerpusser commentedon Aug 2, 2023
For anyone having this crop up while using scoop (CLI or via WinGet UI, etc.) add that Import-Module command at the top of
%SCOOP_DIR%\apps\scoop\current\lib\install.ps1and carry on without frequent hash check failures.AssortedBits commentedon Aug 4, 2024
The team auto-closes bugs with "no activity" as measured by comments. But this ticket has had multiple recent references from other bugs recently. Seems to me those should count as well as comments.
4 remaining items
AssortedBits commentedon May 14, 2025
(not completed, but won’t let me reopen)
joffrey-bion commentedon Jul 6, 2026
This issue wasn't resolved, could it please be re-opened by someone with appropriate permissions?
jazzdelightsme commentedon Jul 10, 2026
Joffrey Bion (@joffrey-bion) did you hit "The PSModulePath Problem", as described above? If so, the problem is environmental, not inside pwsh. If you hit some different problem, you probably need to open a new Issue.
AssortedBits commentedon Jul 14, 2026
Dan Thompson (@jazzdelightsme) Happened with a clean, out-of-the-box env, as that comment you linked to also states can happen when there is an intervening
cmdlayer between pwsh and powershell. So, this is an actual design problem with either pwsh or powershell, until MS states in its documentation somewhere that they do not support running the latter under the former.joffrey-bion commentedon Jul 15, 2026
Yes, sorry I forgot to reply. It is indeed a
PSModulePathproblem for me, but I never set this env var myself. So I do consider it a problem with Powershell, and more specifically pwsh+Powershell combination.If the env is not compatible, I would expect the 2 tools to use different variables for their respective environments.
kilasuit commentedon Aug 6, 2026
AssortedBits - whilst this and #27774 are essentially the same issue, I am going to mark this one as as duplicate of that one, as the title on that is easier for us in coming back to and is more likely to be found in future & whilst I know that may seem like "Issue
This is my comment in that issue & please follow that one for further updates.