From fcf428539fe99dc75fcb5e82597b8a2b30b93c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Cincura=20=E2=86=B9?= Date: Thu, 21 Mar 2024 10:28:04 +0100 Subject: [PATCH] Consistent and idiomatic casing/formatting. (#33362) --- activate.ps1 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/activate.ps1 b/activate.ps1 index db7b3c499f..efd5b6da47 100644 --- a/activate.ps1 +++ b/activate.ps1 @@ -8,7 +8,6 @@ if ($MyInvocation.InvocationName -ne '.') { } function deactivate ([switch]$init) { - # reset old environment variables if (Test-Path variable:_OLD_PATH) { $env:PATH = $_OLD_PATH @@ -16,12 +15,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 @@ -44,11 +43,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 -f Green "($( split-path $PSScriptRoot -leaf )) " -nonewline + Write-Host -f Green "($(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."