Module management for PowerShell Universal.
The Modules page provides information about the modules installed in the system.
You can view and search the modules accessible by PowerShell Universal by visiting the Platform \ Modules page. Searching provides a wildcard result of the modules found in each of the environments defined within PowerShell Universal.
Modules can be installed from the PowerShell Gallery. To search for a module, you can change the drop down next to the search box from Local to PowerShell Gallery. Searches conducted will run against the Gallery rather than locally.
Once a module is found, you'll be able to click the Install button to save it locally. Modules installed in this method will be installed into the Repository directory under Modules.
PowerShell Universal integrates with the
PackageManagementmodule and will automatically pick up on registered package sources. For example, you can register a package source with the command below.
Register-PackageSource -Name MyNuGet -Location https://www.nuget.org/api/v2 -ProviderName NuGet
Once the source has been registered, it will be shown within the drop down on the modules page.
You can also create modules directly in PowerShell Universal. These modules will be created in the Repository directory under Modules.
These modules will be available in all environments.
To create a new module navigate to Platform \ Modules and click Create New Module. Define the module name and version.
Once created, the module will be listed under Universal Modules with the option to edit properties and content as well as delete the module.
When editing the module, it will open a code editor where you can define functions, variables and aliases to export.
PowerShell Universal will add the repository's
Modulesdirectory to the
$ENV:PSModulePathfor all environments. Adding modules to this directory will ensure the module is available to any PowerShell process running with PowerShell Universal.
This section includes information about certain modules and their use within PowerShell Universal.
ActiveDirectorymodule supports native PowerShell 7 support when using the 18.104.22.168 version. When using the 22.214.171.124 version, the Windows Compatibility layer is used when running the commands in PowerShell 7 and the Integrated environment. This can cause problems within PowerShell Universal. Our guidance for this module is as follows.
ActiveDirectorymodule to version 126.96.36.199 which has PowerShell Core support
Choose from 1 of 2 available workarounds:
- Include the
-SkipEditionCheckparameter with Import-Module when importing the ActiveDirectory module
- Use the Windows PowerShell 5.1 environment instead of Integrated/PowerShell Core