Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to set colors prompt prefix and suffix #570

Closed
sirbabyface opened this issue May 2, 2018 · 6 comments
Closed

Not possible to set colors prompt prefix and suffix #570

sirbabyface opened this issue May 2, 2018 · 6 comments

Comments

@sirbabyface
Copy link

System Details

  • posh-git version/path: 0.7.3 ~\Documents\WindowsPowerShell\Modules\posh-git\0.7.3
  • PowerShell version: 5.1.16299.98
  • git version 2.16.2.windows.1
  • OS: Microsoft Windows NT 10.0.16299.0

Issue Description

I'm trying to change the color of the prompt prefix, using information how it is described in the wiki:

$GitPromptSettings.DefaultPromptPrefix.Text = '$(Get-Date -f "MM-dd HH:mm:ss") '
$GitPromptSettings.DefaultPromptPrefix.ForegroundColor = [ConsoleColor]::Magenta

But it doesn't work. It only works by defining the text.

$GitPromptSettings.DefaultPromptPrefix = '$(Get-Date -f "HH:mm:ss")
@rkeithhill
Copy link
Collaborator

That only works with the 1.0.0 beta. You can install that from the PSGallery like so:

Install-Module posh-git -AllowPrerelease -Scope CurrentUser -RequiredVersion 1.0.0-beta1

Note: the -AllowPrerelease parameter is new in PowerShellGet 1.6.0. You might have to update the PowerShellGet module first if you are on an older version of PowerShellGet.

@rkeithhill
Copy link
Collaborator

@sirbabyface Can you verify that this works for you after you have installed and are importing the 1.0.0-beta1 version?

@rkeithhill
Copy link
Collaborator

Support for setting colors for the default prompt prefix/suffix was added in 1.0.0-beta1 and isn't available in 0.7.x.

@simkessy
Copy link

I'm trying to update but it doesn't seem to be working

I get:

Install-Package : A parameter cannot be found that matches parameter name 'AllowPrereleaseVersions'

Install-Package : A parameter cannot be found that matches parameter name 'AllowPrereleaseVersions'.

When I run get-module, powershell get is at version 1.6.6

@dahlbyk
Copy link
Owner

dahlbyk commented Jul 12, 2018

@simkessy try -AllowPrerelease

@rkeithhill
Copy link
Collaborator

If you just updated PowerShellGet, you should exit and start the console. Some folks have run into this issue with PowerShellGet - see the comments/workarounds here - https://github.com/PowerShell/PowerShellGet/issues/205

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants