Get-Module, PSCompatibility, and PSEdition

The PSEdition and PSCompatibleEditions fields were added to the module manifest (a .psd1 file that accompanies a module) with PowerShell 5.1. This allows module authors to state whether a module is PowerShell Core (Core), Windows PowerShell (Desk), or both.

By default, PowerShell Core will not find or use modules from C:WINDOWSsystem32WindowsPowerShellv1.0Modules when running the Get-Module -ListAvailable command or when using Import-Module.

Modules in this one location are subject to additional checks as they have not been tested with PowerShell Core and may not load. Modules in this location may be viewed or loaded in the following circumstances:

  • The module manifest (.psd1 file) accompanying the module has PSEdition set to Core
  • The module manifest uses the PSCompatibleEditions field and includes Core
  • The switch parameter SkipEditionCheck is used with Get-Module or Import-Module

For example, the NetSecurity module may be loaded in PowerShell Core directly using this command:

Import-Module NetSecurity -SkipEditionCheck

Modules loaded from the remaining locations in $env:PSModulePath are not filtered.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.19.56.45