From 671c9e20f1571db351054a8c569a09ce87e4e4b9 Mon Sep 17 00:00:00 2001 From: Keith Hill Date: Sat, 11 Apr 2020 14:35:52 -0600 Subject: [PATCH] Update help doc comments on Get-GitStatus Fix #657 --- src/GitUtils.ps1 | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/GitUtils.ps1 b/src/GitUtils.ps1 index 23300a257..9c9754fc0 100644 --- a/src/GitUtils.ps1 +++ b/src/GitUtils.ps1 @@ -187,16 +187,34 @@ $castStringSeq = [Linq.Enumerable].GetMethod("Cast").MakeGenericMethod([string]) <# .SYNOPSIS - Gets a Git status object that is used by Write-GitStatus. + Gets a Git status object that is used by `Write-GitStatus`. .DESCRIPTION - Gets a Git status object that is used by Write-GitStatus. - The status object provides the information to be displayed in the various - sections of the posh-git prompt. + The `Get-GitStatus` cmdlet gets the status of the current Git repo. + + The status object returned by this cmdlet provides the information + displayed in the various sections of the posh-git prompt. The following + settings in $GitPromptSettings controls what information is returned + in the status object: + + $GitPromptSettings.EnableFileStatus + $GitPromptSettings.EnablePromptStatus + + By default both settings are set to $true. You can disable the return of + file and/or prompt status information by setting one or both of these to + $false. + + The `Force` parameter can be used to override these settings to ensure that + both file and prompt status information is returned in the status object. .EXAMPLE PS C:\> $s = Get-GitStatus; Write-GitStatus $s Gets a Git status object. Then passes the object to Write-GitStatus which writes out a posh-git prompt (or returns a string in ANSI mode) with the information contained in the status object. +.EXAMPLE + PS C:\> $s = Get-GitStatus -Force + Gets a Git status object that always generates all status information even + if $GitPromptSettings has disabled `EnableFileStatus` and/or + `EnablePromptStatus`. .INPUTS None .OUTPUTS