#pscore6 v.s. #powershell 5.x Modules

Because of the cross-platform heterogeneous support design goal in #PsCore6, many platform specific #powershell functionality on the Windows operating system simply cannot, may not or have not yet been migrated over. Since Microsoft does not always fully document details of changes across product versions, this series of blog posts will attempt to identify any similarities and differences between these two PowerShell editions from the command perspective in a typical deployment, namely that of Windows PowerShell 5.x and the newly Release to Manufacturing/Web (RTM/RTW) GA version of PowerShell Core 6.0.0.

Let us kick start with the topic of Modules where the key functionality of PowerShell resides. Out of the box, executing powershell.exe (<= PS5.1) and pwsh.exe (PSCore6) will load a basic set of commands from core modules with exactly the same names:

ModuleType Version Name
———- ——- —-
Manifest 3.1.0.0 Microsoft.PowerShell.Utility
Script 1.2 PSReadline

Even though module names and versions carry the same information, … the difference ends there as the number and type of ExportedCommands do not necessarily match:

PS C:\> Get-Module | % { “$PsItem`t$($PsItem.ExportedCommands.count)” }
Microsoft.PowerShell.Management 94   #59 in #pscore6
Microsoft.PowerShell.Utility 109  #105 in #pscore6
PSReadline 6  #6 in #pscore6

On our test system, the automatic Module loading feature kicked in where the Microsoft.PowerShell.Management module was added to the list in the background.

Although at first glance the quantity of ExportedCommands appears lower in #PsCore6 compared with #powershell, newer commands are introduced (such as Get-Uptime) with older ones updated, removed or not migrated to #PSCore6. In addition, certain commands manifested as Functions are now reborn as Cmdlets (e.g. Get-Verb).

Here is a list of command discrepancies for the above set of standard Modules:

#PsCore6 New Commands x4

Command Note
Remove-Service
Get-Uptime
Get-Verb Cmdlet (Function in #powershell)
Remove-Alias

PRE #PsCore6 Only #powershell Commands* x43

Command Note
Add-Computer
Checkpoint-Computer
Clear-EventLog
Clear-RecycleBin
Complete-Transaction
Disable-ComputerRestore
Enable-ComputerRestore
gcb
Get-Clipboard
Get-ComputerRestorePoint
Get-ControlPanelItem
Get-EventLog
Get-HotFix
Get-Transaction
Get-WmiObject
Invoke-WmiMethod
Limit-EventLog
New-EventLog
New-WebServiceProxy
Register-WmiEvent
Remove-Computer
Remove-EventLog
Remove-WmiObject
Reset-ComputerMachinePassword
Restore-Computer
scb
Set-Clipboard
Set-WmiInstance
Show-ControlPanelItem
Show-EventLog
Start-Transaction
Test-ComputerSecureChannel
Test-Connection
Undo-Transaction
Use-Transaction
Write-EventLog
CFS
ConvertFrom-String
Convert-String
Out-GridView
Out-Printer
Show-Command
Update-List

* only availble in Windows PowerShell 5.10 or earlier

Test platform
Windows Server 2016 RTM Build (Version 1607 OS Build 14393.693)
+ PowerShell Core 6.0.0 GA

Leave a Reply