make powershell a single line

Signed-off-by: Xe <me@christine.website>
This commit is contained in:
Cadey Ratio 2021-12-22 13:04:40 -05:00
parent 0a739a8fcb
commit 1b4a98cd33
1 changed files with 2 additions and 4 deletions

View File

@ -1,7 +1,8 @@
if (Get-InstalledModule -Name posh-git) { if (Get-InstalledModule -Name posh-git) {
Import-Module posh-git Import-Module posh-git
} }
else { else {
Write-Output "Installing prompt... (this may take a moment)"
Set-PSRepository -name PSGallery -InstallationPolicy Trusted Set-PSRepository -name PSGallery -InstallationPolicy Trusted
Install-Module posh-git -Scope CurrentUser -Force -Repository PSGallery Install-Module posh-git -Scope CurrentUser -Force -Repository PSGallery
Import-Module posh-git Import-Module posh-git
@ -9,7 +10,6 @@ else {
$GitPromptSettings.DefaultPromptPrefix.ForegroundColor = [ConsoleColor]::Magenta $GitPromptSettings.DefaultPromptPrefix.ForegroundColor = [ConsoleColor]::Magenta
$GitPromptSettings.DefaultPromptPath.ForegroundColor = [ConsoleColor]::Orange $GitPromptSettings.DefaultPromptPath.ForegroundColor = [ConsoleColor]::Orange
$GitPromptSettings.DefaultPromptBeforeSuffix.Text = '`n'
function global:PromptWriteErrorInfo() { function global:PromptWriteErrorInfo() {
if ($global:GitPromptValues.DollarQuestion) { return } if ($global:GitPromptValues.DollarQuestion) { return }
@ -21,5 +21,3 @@ function global:PromptWriteErrorInfo() {
"`e[31m! `e[0m" "`e[31m! `e[0m"
} }
} }
$global:GitPromptSettings.DefaultPromptBeforeSuffix.Text = '`n$(PromptWriteErrorInfo)'