Skip to content

about_Prompts contains incorrect information about the default prompt #10357

@sdwheeler

Description

@sdwheeler

Can I ask what happened with about_Prompts? It appears to erroneously claim the following:

### BUILT-IN PROMPT

PowerShell includes a built-in Prompt function.

```powershell
function prompt {
    $(if (test-path variable:/PSDebugContext) { '[DBG]: ' }
    else { '' }) + 'PS ' + $(Get-Location) `
    + $(if ($nestedpromptlevel -ge 1) { '>>' }) + '> '
}
```

This incorrect claim was carried over into the later versions of the documentation as well. Shouldn't this be an example of an altered prompt? Because as far as I can tell, this has been the built-in prompt for quite a while:

function prompt {
"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) ";
# .Link
# https://go.microsoft.com/fwlink/?LinkID=225750
# .ExternalHelp System.Management.Automation.dll-help.xml
}

Originally posted by @ImportTaste in #1907 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions