From 7ee13b72e96056386d531a80d8514b8a19dfb0f3 Mon Sep 17 00:00:00 2001 From: Jiri Cincura Date: Wed, 20 Mar 2024 13:27:57 +0100 Subject: [PATCH] Consistent and idiomatic casing/formatting. --- activate.ps1 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/activate.ps1 b/activate.ps1 index 093eecdfc89..e1b2b06a97d 100644 --- a/activate.ps1 +++ b/activate.ps1 @@ -5,7 +5,6 @@ # function deactivate ([switch]$init) { - # reset old environment variables if (Test-Path variable:_OLD_PATH) { $env:PATH = $_OLD_PATH @@ -13,12 +12,12 @@ function deactivate ([switch]$init) { } if (test-path function:_old_prompt) { - Set-Item Function:prompt -Value $function:_old_prompt -ea ignore - remove-item function:_old_prompt + Set-Item Function:prompt -Value $function:_old_prompt -ErrorAction Ignore + Remove-Item function:_old_prompt } - Remove-Item env:DOTNET_ROOT -ea ignore - Remove-Item env:DOTNET_MULTILEVEL_LOOKUP -ea ignore + Remove-Item env:DOTNET_ROOT -ErrorAction Ignore + Remove-Item env:DOTNET_MULTILEVEL_LOOKUP -ErrorAction Ignore if (-not $init) { # Remove the deactivate function Remove-Item function:deactivate @@ -41,11 +40,11 @@ if (-not $env:DISABLE_CUSTOM_PROMPT) { $function:_old_prompt = $function:prompt function dotnet_prompt { # Add a prefix to the current prompt, but don't discard it. - write-host "($( split-path $PSScriptRoot -leaf )) " -nonewline + Write-Host "($(Split-Path $PSScriptRoot -Leaf)) " -NoNewLine & $function:_old_prompt } - Set-Item Function:prompt -Value $function:dotnet_prompt -ea ignore + Set-Item Function:prompt -Value $function:dotnet_prompt -ErrorAction Ignore } Write-Host -f Magenta "Enabled the .NET Core environment. Execute 'deactivate' to exit."