Jaykul / PowerLine

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

Write-GitStatusPowerLine not working #17

Closed dotps1 closed 5 years ago

dotps1 commented 7 years ago

Unable to use Write-GitStatusPowerLine within my PowerLine Prompt

PS>Write-GitStatusPowerLine
Unable to find type [RgbColor].
At C:\Program Files\WindowsPowerShell\Modules\PowerLine\2.3.1\PowerLine.psm1:305 char:9
+         [RgbColor]$ForegroundColor,
+         ~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (RgbColor:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

Unable to find type [RgbColor].
At C:\Program Files\WindowsPowerShell\Modules\PowerLine\2.3.1\PowerLine.psm1:305 char:9
+         [RgbColor]$ForegroundColor,
+         ~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (RgbColor:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

Unable to find type [RgbColor].
At C:\Program Files\WindowsPowerShell\Modules\PowerLine\2.3.1\PowerLine.psm1:305 char:9
+         [RgbColor]$ForegroundColor,
+         ~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (RgbColor:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

Module info:

PS>Get-Module PSGit, PowerLine | select Name, Version

Name      Version
----      -------
PowerLine 2.3.1
PSGit     2.0.4

Running Windows 10 x64 Enterprise 1702.

weloytty commented 7 years ago

I had the same issue, I resolved it by:

1) Updating my profile so that when I create the $PowerLinePrompt variable, I explicitly type it:

$PowerLinePrompt = 1, @(blah,blah,bhal)

becomes

[PowerLine.Prompt]$PowerLinePrompt = 1, @(blah,blah,blah)

Then, I had to modify the .psm, which for me is in

C:\Program Files\WindowsPowerShell\Modules\powerline\2.3.1

I changed all instances of [RgbColor] to [PoshCode.Pansies.RgbColor]

HTH.

dotps1 commented 7 years ago

I tried this as well, it did suppress the errors, however Write-GitStatusPowerLine still does not work.

weloytty commented 7 years ago

hm, dunno. I flailed around with it for a while, but I dont think I made any other changes. The way I finally ended up getting there was running .$PROFILE, then looking at $Error

Jaykul commented 7 years ago

@dotps1 since Write-GitStatusPowerLine is from PSGit, you should file this there ...