Access and use Windows PowerShell cmdlets from your PowerShell Core session on a Windows computer.
Missing cmdlets from PowerShell Core
In the last post, we installed PowerShell Core on a Windows computer. However, if you were to try using some common Windows PowerShell cmdlets from the session or via script, such as Get-WmiObject, you would get an error (below) because Get-WmiObject is a Windows PowerShell cmdlet and not part of PowerShell Core.
PS C:\Users\Demo> Get-WmiObject -Class Win32_ComputerSystem Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program. At line:1 char:1 + Get-WmiObject -Class Win32_ComputerSystem + ~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
Install Windows PowerShell Compatibility Module
Recognizing that in order to get Windows users to start installing and using PowerShell Core it had to be on par with Windows PowerShell, Microsoft released the Windows PowerShell Compatibility Module. This module makes Windows PowerShell cmdlets available from a PowerShell Core session.
[Read more…] about Using the Windows PowerShell Compatibility Module in PowerShell Core