Skip to content

Feature Request: Import-Module validate compatible operating systems #9784

@ThomasNieto

Description

@ThomasNieto

Summary of the new feature/enhancement

There are cases when a module only works on a specific operating systems. Today module authors can tag a module in PSGallery stating which OS is supported. However, there is no enforcement from PowerShell itself to prevent a user from importing an incompatible module.

This request also goes along with #3751 to add support for #requires -OS.

PowerShell 7 would be the best time to release this functionality.

Proposed technical implementation details (optional)

Add CompatibleOS field in the PSD1 with valid values of Windows, MacOS, and Linux. Then Import-Module can be updated use that field to prevent importing an incompatible module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or more

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions