Skip to content

Module loading performance is slow #38

@stephanjohnson

Description

@stephanjohnson

When I enable PowerLine as part of my profile.ps1 PowerShell reports the following message:

Loading personal and system profiles took 1608ms

Loading times vary between 1600 and 1800ms.

Is there any way to optimize the loading time?

here is my profile.ps1 file:

#requires -module @{ModuleName='PowerLine';ModuleVersion='3.0.3'}, @{ModuleName='PSGit'; ModuleVersion='2.0.4'}

$global:prompt = @(
    { "&Gear;" * $NestedPromptLevel }
    { if($pushd = (Get-Location -Stack).count) { "$([char]187)" + $pushd } }
    { $pwd.Drive.Name }
    { Split-Path $pwd -leaf }
    { Get-GitStatusPowerline }
)

Set-PowerLinePrompt -SetCurrentDirectory -PowerLineFont -Title {
    -join @(if (Test-Elevation) { "Administrator: " }
        if ($IsCoreCLR) { "pwsh - " } else { "Windows PowerShell - "}
        Convert-Path $pwd)
} -Colors "DarkBlue", "White", "Cyan", "White", "DarkBlue", "DarkCyan"

Regards,

Stephan

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions