Closed xkeshav closed 11 months ago
This is normal behavior in PowerShell. The install process notifies you that you have an existing command called gsi
already installed. This is presumably an alias. In PowerShell, you can run get-command gsi
to see what it is referring to. "Overwriting" doesn't mean overwriting files, just that you could have command conflicts in the same session. That said, if you already installed PSScriptTools, you should use Update-Module
. The first thing I would recommend is learning what gsi
is.
installing for very first time,
PS D:\Developer\blog> Get-Command gsi
CommandType Name Version Source
----------- ---- ------- ------
Function gsi 0.3.5 git-aliases
its is source from git-aliases , now how do I remove that one ?
Ok. You can still safely install the PSScriptTools module. It will not overwrite or remove any files in the git-aliases module. What this means is if you have a session open with the git-aliases module imported and then import the PSScriptTools module, the gsi
alias from PSScriptTools will 'overwrite' the gsi
command from git-aliases in that session. This is only an issue when you are trying to use both modules simultaneously.
One solution is that when you import one of the modules, say the PSScriptTools module, tell PowerShell to use a prefix.
Import-Module PSScriptTools -prefix t
Now, every command in the module will have a t
at the beginning of the name. Now you'll have the command tgsi
from the PSScriptTools module, and your original gsi
command from git-aliases is untouched.
The catch is that you must manually import the module with the prefix.
Thanks for the solution.
Describe the problem
I tried using the given command
but it stops with below error
Install-Package: The following commands are already available on this system:'gsi'. This module 'PSScriptTools' may override the existing commands. If you still want to install this module 'PSScriptTools', use -AllowClobber parameter.
how do we fix this as I do not want to override existing commands.
Expectation
No response
Additional Information
Windows detail
PowerShell version
4.0
Platform
None
Additional Checks