What is Install-Module command in Powershell?

I had previously installed PSGet which had overwritten my version of Install-Module. You can check this by running help install-module and see which version it refers to.

I couldn't find uninstall documentation for PSGet so I removed it by deleting the folder C:\Users\Rory\Documents\WindowsPowerShell\Modules\PSGet. Now help install-module refers to the microsoft version.


You can work around the clash by prefixing the command with the module name:

PsGet installed and getting in the way:

C:\repos> install-module csproj
Module csproj was not found in central repository
At C:\Users\Administrator\Documents\WindowsPowerShell\Modules\PsGet\PsGet.psm1:694 char:13
+             throw "Module $Module was not found in central repository ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Module csproj w...tral repository:String) [], RuntimeException
    + FullyQualifiedErrorId : Module csproj was not found in central repository

using the qualified name:

C:\repos> powershellget\install-module csproj

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running
the Set-PSRepository cmdlet. Are you sure you want to install the modules from 'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): y
C:\repos>

Thanks to http://windowsitpro.com/blog/dealing-cmdlet-name-conflicts

Module name obtained from reading the url of the documentation - https://msdn.microsoft.com/powershell/reference/5.1/PowerShellGet/install-module

More info: https://andrwwatt.wordpress.com/2006/05/13/coping-with-a-powershell-naming-clash/

Tags:

Powershell