Powershell Tip #51: Avoid command name conflicts in a session

By | October 6, 2015

Tip: You can use -Prefix or -NoClobber parameters to avoid command name conflicts in a session (ex: when importing functions from a module).

NoClobber: does not overwrite an existing command. If the command (Get-Something) has the same name than an existing one in the session, the command is not imported.

Prefix: adds a prefix (DEMO) to the noun (-Something) in the names of the imported module members.

import-module-prefix-noclobber-powershell

Note: The –NoClobber parameter shows conflicts only when the switch parameter -Verbose is used.


previous-buttonnext-button

2 thoughts on “Powershell Tip #51: Avoid command name conflicts in a session

  1. Pingback: Powershell Tip #50: Difference between Write-Error and throw | Powershell Guru

  2. Pingback: Powershell Tip #52: Count the number of lines of a file | Powershell Guru

Leave a Reply

Your email address will not be published. Required fields are marked *