Jaykul / PowerLine

A more PowerShell prompt
MIT License
567 stars 31 forks source link

Error running Install-Module PowerLine #33

Closed jzabroski closed 5 years ago

jzabroski commented 6 years ago

Nowhere in the documentation is this gotcha mentioned. Is this on purpose? Can you explain why it would override Write-Host?

PS C:\source\> install-module PowerLine

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"): a
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.6.7\PSModule.psm1:9491 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
    + FullyQualifiedErrorId : CommandAlreadyAvailable,Validate-ModuleCommandAlreadyAvailable,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
PS C:\source> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.17134.228
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17134.228
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
sushruth commented 6 years ago

I have the same issue. However, using the line below as the error suggested, I could install it successfully. Not sure what it is or how safe it is.

 Install-Module PowerLine -AllowClobber
Jaykul commented 5 years ago

That's true. I forgot about that in PANSIES. PowerLine uses PANSIES for color help...

PANSIES replaces Write-Host with a backwards-compatible version that supports full RGB colors and also works faster... 😀

Getting PANSIES merged into PowerShell Core is on my TODO list, but for now, yes, it's on purpose and safe.

jzabroski commented 5 years ago

Thanks for updating the documentation to explain PANSIES