File modules




















When this option is set the value of environment variable or defined fallback value is returned in display mode.

Changed in version 5. Returns value of designated variant. If variant is not defined, value is returned if set, an empty string is returned otherwise. The getvariant command should be preferred over the ModuleVariant Tcl array to query a variant value. When modulefile is evaluated in display mode, getvariant returns variant name enclosed in curly braces e. When this option is set the value of variant or defined fallback value is returned in display mode.

If a list contains more than one modulefile , then each member acts as a boolean OR operation. If an argument for is-avail is a directory and a modulefile exists in the directory is-avail would return a true value. The is-loaded command returns a true value if any of the listed modulefiles has been loaded or if any modulefile is loaded in case no argument is provided. If an argument for is-loaded is a directory and any modulefile from the directory has been loaded is-loaded would return a true value.

The is-saved command returns a true value if any of the listed collections exists or if any collection exists in case no argument is provided. If a list contains more than one collection , then each member acts as a boolean OR operation. In case no collection argument is provided, a true value will only be returned if a collection matching currently set target exists. If a list contains more than one directory , then each member acts as a boolean OR operation.

Contains the same sub-commands as described in the module man page in the Module Sub-Commands section. Exception made for the following sub-commands that can only be used outside of a modulefile context: path , paths , autoinit , help , clear , sh-to-mod , edit , config , refresh , source and state. Also the following sub-commands cannot be used but have a modulefile command counterpart: prepend-path , append-path , remove-path , is-loaded , is-saved , is-used , is-avail and info-loaded.

This command permits a modulefile to load or unload other modulefiles. No checks are made to ensure that the modulefile does not try to load itself. Often it is useful to have a single modulefile that performs a number of module load commands. For example, if every user on the system requires a basic set of applications loaded, then a core modulefile would contain the necessary module load commands.

The --not-req option may be set for the load , try-load , load-any , unload and switch sub-commands to inhibit the definition of an implicit prereq or conflict requirement onto specified modules.

On try-load sub-command, if specified modulefile is not found thus loaded, no implicit prereq requirement is defined over this module. The load-any sub-command loads one modulefile from the specified list. An error is obtained if no modulefile from the list can be loaded. No operation is performed if a modulefile from the list is found already loaded. The unuse sub-command accepts the --remove-on-unload , --noop-on-unload , --append-on-unload and --prepend-on-unload options to control the behavior to apply when modulefile is unloaded.

See remove-path for further explanation. The load , try-load , load-any and switch sub-commands accept the --tag option to apply specified tags to modulefile once loaded. Option accepts a concatenation of multiple module tags separated by colon character. Command line switches --auto , --no-auto and --force are ignored when passed to a module command set in a modulefile. Changed in version 4. Assigns the modulefile to the alias name. This command should be placed in one of the modulecmd.

Forbid use of modulefile. An error is obtained when trying to evaluate a forbidden module. If --after option is set, forbidding is only effective after specified date time. Following the same principle, if --before option is set, forbidding is only effective before specified date time. If no time HH:MM is specified, is assumed.

If --not-user option is set, forbidding is not applied if the username of the user currently running modulecmd. Following the same approach, if --not-group option is set, forbidding is not applied if current user is member of one the group specified.

When both options are set, forbidding is not applied if a match is found for --not-user or --not-group. Error message returned when trying to evaluate a forbidden module can be supplemented with the text message set through --message option. When a nearly forbidden module is evaluated a warning message is issued to inform module will soon be forbidden. This warning message can be supplemented with the text message set through --nearly-message option.

If a module-forbid command applies to a modulefile also targeted by a module-hide --hard command, this module is unveiled when precisely named to return an access error. Forbidden modules included in the result of an avail sub-command are reported with a forbidden tag applied to them.

Nearly forbidden modules included in the result of an avail or a list sub-command are reported with a nearly-forbidden tag applied to them. See Module tags section in module.

The parameter modulefile may leverage a specific syntax to finely select module version see Advanced module version specifiers section below. Hide modulefile to exclude it from available module search or module selection unless query refers to modulefile by its exact name. When --soft option is set, modulefile is also set hidden, but hiding is disabled when search or selection query's root name matches module's root name. This soft hiding mode enables to hide modulefiles from bare module availability listing yet keeping the ability to select such module for load with the regular resolution mechanism i.

When --hard option is set, modulefile is also set hidden and stays hidden even if search or selection query refers to modulefile by its exact name.

When --hidden-loaded option is set, hidden state also applies to the modulefile when it is loaded. Hidden loaded modules do not appear on list sub-command output, unless --all option is set. Their loading or unloading informational messages are not reported unless the verbosity of Modules is set to a level higher than verbose.

Hidden loaded modules are detected in any cases by state query commands like is-loaded. If --after option is set, hiding is only effective after specified date time.

Following the same principle, if --before option is set, hiding is only effective before specified date time. If --not-user option is set, hiding is not applied if the username of the user currently running modulecmd.

Following the same approach, if --not-group option is set, hiding is not applied if current user is member of one the group specified.

When both options are set, hiding is not applied if a match is found for --not-user or --not-group. If the --all option is set on avail , aliases , whatis or search sub-commands, hiding is disabled thus hidden modulefiles are included in module search. Hard-hidden modules i. Thus in such context a hidden module should always be referred by its exact full name e.

A hard-hidden module cannot be unveiled or selected in any case. If several module-hide commands target the same modulefile , the strongest hiding level is retained which means if both a regular, a --soft hiding command match a given module, regular hiding mode is considered. If both a regular and a --hard hiding command match a given module, hard hiding mode is retained.

A set --hidden-loaded option is retained even if the module-hide statement on which it is declared is superseded by a stronger module-hide statement with no --hidden-loaded option set. Hidden modules included in the result of an avail sub-command are reported with a hidden tag applied to them. Hidden loaded modules included in the result of a list sub-command are reported with a hidden-loaded tag applied to them.

This tag is not reported on avail sub-command context. Provide information about the modulecmd. Some of the information is specific to the internals of modulecmd.

Returns the currently running modulecmd. Returns 1 if modulecmd. Returns the names of currently loaded modules matching passed modulefile. The parameter modulefile might either be a fully qualified modulefile with name and version or just a directory which in case all loaded modulefiles from the directory will be returned. This command only returns the name and version of designated loaded module. The defined variants of the loaded module are not included in the returned string.

Returns the current modulecmd. Return the name of the modulefile. This is not the full pathname for modulefile. See the Modules Variables section for information on the full pathname. This command only returns the name and version of currently evaluating modulefile.

The defined variants are not included in the returned string. See getvariant command or ModuleVariant array variable to get defined variant values for currently evaluating modulefile. Return the current shell under which modulecmd. The current shell is the first parameter of modulecmd.

If a shellname is given, returns 1 if modulecmd. Return the family of the shell under which modulefile was invoked if no shelltypename is given. As of module-info shell this depends on the first parameter of modulecmd.

The output reflects a shell type determining the shell syntax of the commands produced by modulecmd. If a shelltypename is given, returns 1 if modulecmd.

Returns all tags assigned to currently evaluated modulefile as a list of strings if no tag name is given see Module tags section in module. When tags are assigned to specific module variants, they are returned only if this variant is the one currently evaluated.

Returns 1 if one of the tags applying to currently evaluated modulefile is tag. Returns 0 otherwise. Returns all the groups the user currently running modulecmd. Returns 1 if one of the group current user running modulecmd. If the Modules Tcl extension library is disabled, the id 1 command is invoked to fetch groups of current user. Returns the username of the user currently running modulecmd.

Returns 1 if username of current user running modulecmd. If the Modules Tcl extension library is disabled, the id 1 command is invoked to fetch username of current user. Associate tag to designated modulefile. This tag information will be reported along modulefile on avail and list sub-commands see Module tags section in module.

Tag information can be queried during modulefile evaluation with the module-info tags modulefile command. If --not-user option is set, the tag is not applied if the username of the user currently running modulecmd. Following the same approach, if --not-group option is set, the tag is not applied if current user is member of one the group specified.

When both options are set, the tag is not applied if a match is found for --not-user or --not-group. Tags inherited from other modulefile commands or module states cannot be set with module-tag. Otherwise an error is returned. Those special tags are: auto-loaded , forbidden , hidden , hidden-loaded , loaded and nearly-forbidden. When tag equals sticky or super-sticky , designated modulefile is defined Sticky modules. When tag equals keep-loaded , designated modulefile is not automatically unloaded when it has been auto-loaded and its dependent modules are getting unloaded.

Assigns the symbolic version-name to the modulefile. The special version-name default specifies the default version to be used for module commands, if no specific version is given. This replaces the definitions made in the. Assigns the modulefile to the virtual module name. This command should be placed in rc files in order to define virtual modules.

A virtual module stands for a module name associated to a modulefile. The modulefile is the script interpreted when loading or unloading the virtual module which appears or can be found with its virtual name. The parameter modulefile corresponds to the relative or absolute file location of a modulefile. Defines a string which is displayed in case of the invocation of the module whatis command. There may be more than one module-whatis line in a modulefile.

Resources 3. Basic Rules 3. Use Standard American English 3. Write for a Global Audience 3. Follow Naming Conventions 3. Important Information First 3. Sentence Structure 3. Avoid padding 3. Avoid redundant prepositional phrases 3.

Avoid verbosity 3. Avoid pomposity 3. Action verbs, menus, and commands 4. Voice Style 4. Active Voice 5. Trademark Usage 5. General Rules: 5.

Guidelines for the proper use of trademarks: 5. The importance of Ansible trademarks 5. Common Ansible Trademarks 5. Other Common Trademarks and Resource Sites: 6.

Grammar and Punctuation 6. Common Styles and Usage, and Common Mistakes 7. Acronyms 7. Applications 7. Asks for 7. Back up 7. Backup 7. Backward 7. Backwards compatibility 7. By way of 7. CD or cd 7. CD-ROM 7. Command line 7.

Daylight saving time DST 7. Download 7. Failover 7. Fail over 7. Fewer 7. Also, commands in your session can hide commands that the module added. To detect name conflicts, use the All parameter of the Get-Command cmdlet. The All parameter gets all commands with the specific name in the session. The Prefix parameter adds a prefix to the names of imported commands so that they are unique in the session.

The NoClobber parameter does not import any commands that would hide or replace existing commands in the session. You can also use the Alias , Cmdlet , Function , and Variable parameters of Import-Module to select only the commands that you want to import, and you can exclude commands that cause name conflicts in your session. Module authors can prevent name conflicts by using the DefaultCommandPrefix property of the module manifest to add a default prefix to all command names.

The value of the Prefix parameter takes precedence over the value of DefaultCommandPrefix. Even if a command is hidden, you can run it by qualifying the command name with the name of the module or snap-in in which it originated.

The PowerShell command precedence rules determine which command runs when the session includes commands with the same name. For example, when a session includes a function and a cmdlet with the same name, PowerShell runs the function by default. When the session includes commands of the same type with the same name, such as two cmdlets with the same name, by default, it runs the most recently added command.

You can add commands to your session from modules and snap-ins. Modules can add all types of commands, including cmdlets, providers, and functions, and items, such as variables, aliases, and PowerShell drives. Snap-ins can add only cmdlets and providers.

Before removing a module or snap-in from your session, use the following commands to determine which commands will be removed. The commands that a module exports should follow the PowerShell command naming rules. If the module that you import exports cmdlets or functions that have unapproved verbs in their names, the Import-Module cmdlet displays the following warning message. Use the Verbose parameter for more detail or type Get-Verb to see the list of approved verbs.

This message is only a warning. The complete module is still imported, including the non-conforming commands. Although the message is displayed to module users, the naming problem should be fixed by the module author. In PowerShell 2. Core snap-in is added to every session by default. Modules are loaded automatically on first-use. Remote sessions, including sessions that are started by using the New-PSSession cmdlet, are older-style sessions in which the built-in commands are packaged in snap-ins.

For more information, see the logging and group policy articles. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Please rate your experience Yes No. Any additional feedback? Note Remote sessions, including sessions that are started by using the New-PSSession cmdlet, are older-style sessions in which the built-in commands are packaged in snap-ins.

Submit and view feedback for This product This page.



0コメント

  • 1000 / 1000