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

Improve instructions #27

Open
MisinformedDNA opened this issue Apr 28, 2018 · 3 comments
Open

Improve instructions #27

MisinformedDNA opened this issue Apr 28, 2018 · 3 comments

Comments

@MisinformedDNA
Copy link

The current instructions do not make it obvious which commands I am supposed to perform vs what's going on in the background.

For instance, am I supposed to add this:

function prompt {
    -join $prompt.Invoke()
}

or

[System.Collections.Generic.List[ScriptBlock]]$Prompt = @(
    { "PS " }
    { $executionContext.SessionState.Path.CurrentLocation }
    { '>' * ($nestedPromptLevel + 1) }
)

or as per Sample.ps1 (which doesn;t run successfully)

$global:PowerLinePrompt = 1,
    # two lines
    @(
        # on the first line, two columns -- the first one is null (empty), the second is right-justified
        $null,
        @(
            @{ text = { New-PowerLineBlock (Get-Elapsed) -ErrorBackgroundColor DarkRed -ErrorForegroundColor White -ForegroundColor Black -BackgroundColor DarkGray } }
            @{ bg = "Gray";     fg = "Black"; text = { Get-Date -f "T" } }
        )
    ),
    (
        @{ bg = "Blue";     fg = "White"; text = { $MyInvocation.HistoryId } },
        @{ bg = "Cyan";     fg = "White"; text = { [PowerLine.Prompt]::Gear * $NestedPromptLevel } },
        @{ bg = "Cyan";     fg = "White"; text = { if($pushd = (Get-Location -Stack).count) { "$([char]187)" + $pushd } } },
        @{ bg = "DarkBlue"; fg = "White"; text = { $pwd.Drive.Name } },
        @{ bg = "DarkBlue"; fg = "White"; text = { Split-Path $pwd -leaf } },
        # This requires my PoshCode/PSGit module and the use of the SamplePSGitConfiguration -- remove the last LeftCap in that.
        @{ bg = "DarkCyan";               text = { Get-GitStatusPowerline } }
    )

It would help a lot if there were some simple tutorials/walkthroughs.

@weloytty
Copy link

I can understand how that is confusing, it's the old v2 syntax. I did a PR to update it, hopefully it will give you a better idea of what powerline can do. The pr is #28

I used Jaykul's profile at https://github.com/Jaykul/Profile for a lot of help, it can be intimidating though. I keep my profile in github too, so its easy to install on machines I have to use, you can look at https://github.com/weloytty/Profile for the underachiever's version of a profile.

@kort3x
Copy link

kort3x commented Jul 2, 2018

I second this.
The module might be cool and all but the I have no clue how to use it.

@Jaykul
Copy link
Owner

Jaykul commented Dec 11, 2018

I'll work on the docs some more...

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

No branches or pull requests

4 participants