PowerLine icon indicating copy to clipboard operation
PowerLine copied to clipboard

Install fails without -AllowClobber

Open bartecargo opened this issue 6 years ago • 1 comments

The installation instructions imply that Pansies is optional:

NOTE: If you don't have my PANSIES module for ANSI Escape Sequences, you may want to install that separately

However, I'm unable to install the PowerLine module because it appears to want to pull in the Pansies module, yet I don't want to clobber Write-Host:

C:\WINDOWS\system32> Install-Module PowerLine                                                                          
PackageManagement\Install-Package : The following commands are already available on this system:'Write-Host'. This
module 'Pansies' may override the existing commands. If you still want to install this module 'Pansies', use
-AllowClobber parameter.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package],
   Exception
    + FullyQualifiedErrorId : CommandAlreadyAvailable,Validate-ModuleCommandAlreadyAvailable,Microsoft.PowerShell.Pack
   ageManagement.Cmdlets.InstallPackage

bartecargo avatar Sep 04 '19 20:09 bartecargo

I can clarify that in the docs, but you're right, PANSIES is not optional. It does a lot of the work of dealing with colors. Additionally, it's Write-Host is fully backward compatible and is faster than the built-in Write-Host.

Jaykul avatar Oct 26 '19 15:10 Jaykul