ps-rule module#
Abstract
Use the module
command to manage or restore modules tracked by the module lock file and configured options. (ps-rule.lock.json
).
The module lock file, provides consistent module versions across multiple machines and environments.
For more information, see Lock file.
Usage#
To use the module
command, choose one of the available subcommands:
module init
#
Initialize a new lock file based on existing options. Using this command, the module lock file is created or updated.
If ps-rule.yaml
option are configured to included module (Include.Modules
), these a automatically added to the lock file.
Any required version constraints set by the Requires
option are taken into consideration.
Optional parameters:
--force
- Force the creation of a new lock file, even if one already exists.
For example:
For example, force the creation of a new lock file, even if one already exists:
module list
#
List any module and the installed versions from the lock file.
module add
#
Add one or more modules to the module lock file. If the lock file does not exist, it is created.
By default, the latest stable version of the module is added.
Any required version constraints set by the Requires
option are taken into consideration.
To use a specific module version, use the --version
argument.
Optional parameters:
--version
- Specifies a specific version of the module to add. By default, the latest stable version of the module is added. Any required version constraints set by theRequires
option are taken into consideration.--prerelease
- Accept pre-release versions in addition to stable module versions. By default, pre-release versions are not included. A pre-release version may also be accepted whenRequires
includes pre-releases.
For example:
For example, a specific version of the module is added:
For example, include pre-release versions added:
module remove
#
Remove one or more modules from the lock file.
For example:
module restore
#
Restore modules from the module lock file (ps-rule.lock.json
) and configured options.
Optional parameters:
--force
- Restore modules even when an existing version that meets constraints is already installed locally.
For example:
For example, force restore of all modules:
module upgrade
#
Upgrade to the latest versions for all or a specific module within the lock file.
Optional parameters:
--prerelease
- Accept pre-release versions in addition to stable module versions. By default, pre-release versions are not included. A pre-release version may also be accepted whenRequires
includes pre-releases.
For example:
For example, upgrade a specific module and include pre-release versions:
Next steps#
For more information on the module lock file, see Lock file.
To find out more about the commands available with the PSRule CLI, see PSRule CLI.