Ensure PowerShell Module
- 14 May 2021
- 1 Minute to read
- Print
- DarkLight
- PDF
Ensure PowerShell Module
- Updated on 14 May 2021
- 1 Minute to read
- Print
- DarkLight
- PDF
Article Summary
Share feedback
Thanks for sharing your feedback!
This is generated from the built in components of BuildMaster 7.0.0, and may be different than what you have installed (especially if you have extensions); go to [User Icon] -> Documentation within your BuildMaster instance to see exactly what operations are available.
Ensure PowerShell Module
Ensures that the specified PowerShell module is installed.
Script usage:
Ensure-PsModule( Module: <text>, [Version: <text>], [MinimumVersion: <text>], [Force: <true/false>], [Repository: <text>], [Scope: <text>], [Exists: <true/false>], [AllowClobber: <true/false>], [AllowPrerelease: <true/false>], [AcceptLicense: <true/false>], [AllVersions: <true/false>], [Parameters: <%(key1: value1, ...)>], [Verbose: <true/false>], [DebugLogging: <true/false>] );
This operation may be prefixed with PowerShell::
, although this is a built-in namespace and isn't really necessary.
Arguments:
Name | Format | Script Usage | Usage Notes |
---|---|---|---|
☆ Module | text | Module | This argument is required. |
Version | text | Version | |
Minimum Version | text | MinimumVersion | |
Force | true/false | Force | Use this to force installation to bypass the Untrusted Repository error or to force this version to install side-by-side with other versions that already exist. |
Repository Name | text | Repository | |
Scope | text | Scope | Typically "Local" or "Global" |
Exists | true/false | Exists | |
Allow Clobber | true/false | AllowClobber | |
Allow Prerelease | true/false | AllowPrerelease | |
Accept License | true/false | AcceptLicense | For PowerShell Core only! |
All Versions | true/false | AllVersions | |
Parameters | %(key1: value1, ...) | Parameters | Additional parameters to pass to Install-Module. Example: %(DestinationPath: C:\hdars\1000.txt, Contents: test file ensured) |
Verbose | true/false | Verbose | |
Debug Logging | true/false | DebugLogging |
Note: An argument may be explicitly converted to an integral type by prefixing the value with [type::<typeName>], where <typeName> is one of: int, uint, long, ulong, double, decimal. Normally this conversion is performed automatically and this is not necessary.
Example:
# ensures the existence of a module on the server Ensure-PsModule ( Module: PackageManagement, MinimumVersion: 1.4.6, Repository: internal-powershell, Exists: true ); # ensures the existence of a specific version of a module on the server Ensure-PsModule ( Module: PackageManagement, Version: 1.4.6, Repository: internal-powershell, Force: true, Exists: true );
Was this article helpful?