Skip to content

Commit

Permalink
Add New-GitPromptSettings to make it easier to create this type
Browse files Browse the repository at this point in the history
  • Loading branch information
rkeithhill committed Feb 18, 2019
1 parent 74eca62 commit 5a5b604
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

- Moved SSH agent functionality to <https://github.com/dahlbyk/posh-sshell>.

### Added

- New-GitPromptSettings to provide an easy way to create a PoshGitPromptSettings object which can be used to
reset to the default settings.

## 1.0.0-beta2 - May 13, 2018

The 1.0.0 release is targeted specifically at Windows PowerShell 5.x and (cross-platform) PowerShell Core 6.x, both of
Expand Down
14 changes: 14 additions & 0 deletions src/GitPrompt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ if ($Host.UI.RawUI.BackgroundColor -eq [ConsoleColor]::DarkMagenta) {
$s.WorkingColor.ForegroundColor = 'Red'
}

<#
.SYNOPSIS
Creates a new instance of the PoshGitPromptSettings that can be assigned to $GitPromptSettings.
.DESCRIPTION
Creates a new instance of the PoshGitPromptSettings that can be used to reset the
$GitPromptSettings values back to their defaults.
.EXAMPLE
PS> $GitPromptSettings = New-GitPromptSettings
This will reset the current $GitPromptSettings back to the defaults.
#>
function New-GitPromptSettings {
[PoshGitPromptSettings]::new()
}

<#
.SYNOPSIS
Writes the object to the display or renders it as a string using ANSI/VT sequences.
Expand Down
1 change: 1 addition & 0 deletions src/posh-git.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ FunctionsToExport = @(
'Get-GitDirectory',
'Get-PromptConnectionInfo',
'Get-PromptPath',
'New-GitPromptSettings',
'Update-AllBranches',
'Write-GitStatus',
'Write-GitBranchName',
Expand Down
1 change: 1 addition & 0 deletions src/posh-git.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ $exportModuleMemberParams = @{
'Get-GitStatus',
'Get-PromptConnectionInfo',
'Get-PromptPath',
'New-GitPromptSettings',
'Update-AllBranches',
'Write-GitStatus',
'Write-GitBranchName',
Expand Down

0 comments on commit 5a5b604

Please sign in to comment.