PowerShell 7
PowerShell 7, the latest version of Microsoft’s command-line shell and scripting language, comprises several enhancements and new features. One significant aspect of PowerShell 7 is its Module Compatibility.s
By achieving cross-platform interoperability, PowerShell 7 will let users take advantage of its features on numerous operating systems, including Windows, macOS, and various Linux distributions. This cross-platform nature catalyzes a more vibrant module ecosystem as developers can create modules that are not restricted to a single platform.
This article aims to discuss module compatibility in PowerShell 7.
What is PowerShell 7 Module Compatibility?
Module compatibility defines the ability of a PowerShell module to function seamlessly across different versions of PowerShell. The PowerShell 7, being designed as a cross-platform framework, offers enhanced compatibility with PowerShell Core, while also retaining compatibility with Windows PowerShell, ensuring backward compatibility.
One of the primary challenges in achieving module compatibility lies in the differences between PowerShell 7 and its predecessors. While PowerShell 7 embraces the “.NET Core runtime”, Windows PowerShell relies on the “.NET Framework”. These underlying frameworks may utilize different APIs or possess varying levels of support for certain features, making adaptation of modules a non-trivial task.
Therefore, Microsoft has introduced the following strategies and modules to tackle this challenge:
- Azure PowerShell
- MSGraph PowerShell SDK
- Windows Management Modules
- Exchange Online Management 2.0
- Modules for SQL Server
- PowerShell Gallery
- Community Support
1. Azure PowerShell
A set of cmdlets called the “Az PowerShell” module allow PowerShell users to manage Azure resources directly. For using the Az PowerShell module across all platforms, PowerShell 7.0.6 LTS or higher is advised.
2. MSGraph PowerShell SDK
The Microsoft Graph SDKs are made to conveniently create applications that are high-quality, effective, and robust and use Microsoft Graph. For using the “Microsoft Graph PowerShell SDK”, PowerShell versions 7 and later are advised.
3. Windows Management Modules
Various Windows functions and services are managed and supported by the “Windows Management Modules”. The majority of these modules have either been upgraded to be natively compatible with PowerShell 7 or have been tested for compatibility.
Depending on the Windows Edition and how the module is packaged for that Edition, these modules are installed in different ways.
4. Exchange Online Management 2.0
The “Exchange Online PowerShell V2 module (EXO V2)” provides access to all Exchange-related PowerShell environments in Microsoft 365, including Security & Compliance PowerShell and the stand-alone Exchange Online Protection (EOP) PowerShell. PowerShell 7.0.3 and later versions support EXO v2.0.4 or later.
5. Modules for SQL Server
There are two modules for SQL Server PowerShell:
SqlServer: This module offers updated versions of the SQLPS cmdlets in addition to new cmdlets to support the most recent SQL capabilities.
SQLPS: Using the PowerShell subsystem, SQL Agent does agent jobs in agent job steps using the SQLPS module.
Note: PowerShell 5.0 or later is required for the SQL Server modules.
6. PowerShell Gallery
PowerShell 7 encompasses improved module discoverability, which simplifies the process of locating and acquiring modules. The “PowerShell Gallery”, a central repository of publicly available PowerShell modules, is seamlessly integrated into PowerShell 7.
Users can use the “Install-Module” cmdlet to conveniently browse, download, and install modules directly from the command line interface. This enhanced module discoverability expands the scope of accessible modules, empowering users to tap into a wider range of community-contributed resources.
7. Community Support
PowerShell 7’s module compatibility is reinforced by robust community support. PowerShell has cultivated a thriving community, actively contributing new modules, providing support, and sharing best practices.
Conclusion
PowerShell 7 module compatibility is a vital aspect of utilizing the full potential of this scripting language. Achieving module compatibility ensures a smooth transition to PowerShell 7 for users and expands the range of available modules. As PowerShell 7 continues to evolve, its module compatibility will be instrumental in driving innovation and productivity among its users.