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.
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
PSGallerystating 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
CompatibleOSfield in the PSD1 with valid values ofWindows,MacOS, andLinux. ThenImport-Modulecan be updated use that field to prevent importing an incompatible module.