I can query a module I want to install using
Find-Module -Name AzureAD
However, I must know beforehand that this module can only be installed in PowerShell v5/Desktop and not PowerShell v7/Core, otherwise I might install it or try to run it in the wrong version and get all sorts of issues.
Apparently it should be possible to find this information using the 'Tag' property:
Find-Module -Tag PSEdition_Desktop
Find-Module -Tag PSEdition_Core
However, it doesn't seem to work (perhaps the module authors do not bother filling in this value).
Is there any way to find the target PowerShell version of a module before installing it?
I think you can use the Find-Module
command and use the AdditionalMetadata
property.
But I think this could be the same result as your -Tag
thing.