Exploring compatibility solution limitations
In the previous recipe, you saw how you could use the Windows PowerShell compatibility mechanism built into PowerShell 7. This solution provides you with access to modules that their owners have not yet converted to run natively in PowerShell 7. This solution provides improved compatibility but does have some minor limitations.
The first limitation is discovery. You can't easily discover unsupported commands. You cannot, for example, use PowerShell 7's Get-Module
to list the ServerManager
module, even though you can use Get-Command
to discover commands inside the module.
Another limitation of the compatibility solution is that PowerShell 7 does not import any display or type XML contained in the module. The result is that some commands may display output slightly differently. There are ways around this, including just running the entire command inside a remoting session.
Despite the compatibility solution, some Windows...