Powershell Framework is broken (again) under Powershell Core
See original GitHub issuePrerequisites
- 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 : CommandNotFoundException
Environment 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.0
Visuals
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Powershell broke - basic commands not working ...
At some point my Powershell broke. Standard commands like 'Write-Host' stopped working. I was using VS Code on Windows 10 and using ...
Read more >Need to repair the windows powershell 5.1 to fix basic ...
I already have PowerShell Core installed and running. I would like to have both of them working simultaneously. Is there any other way...
Read more >Resolving PowerShell module assembly dependency ...
This presents issues when a module's dependencies conflict with already-loaded DLLs and may prevent using two otherwise unrelated modules in the ...
Read more >Differences between Windows PowerShell 5.1 and ...
This article summarizes the differences and breaking changes from Windows PowerShell 5.1 and the current version of PowerShell that is based ...
Read more >Cannot install powershell modules - Microsoft Q&A
My problem is that I am not able to install modules to my powershell console. Example: Install-module -Name AzureAD.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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.ps1
and carry on without frequent hash check failures.