From 323b9e88f7ea5e03b5c6ea3893ad4cd45b6324f5 Mon Sep 17 00:00:00 2001 From: Alex Lopez Date: Tue, 10 Sep 2019 21:35:12 -0400 Subject: [PATCH 1/3] Update NewProfile.ps1 Removed redundant display (Core) in the console as it's displayed in the Title --- Scripts/At_Your_Fingertips/NewProfile.ps1 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Scripts/At_Your_Fingertips/NewProfile.ps1 b/Scripts/At_Your_Fingertips/NewProfile.ps1 index d4f2608..7fc2f05 100644 --- a/Scripts/At_Your_Fingertips/NewProfile.ps1 +++ b/Scripts/At_Your_Fingertips/NewProfile.ps1 @@ -8,7 +8,6 @@ # Added PowerShell-Core compatibility # # 1) PS prompt -# - detect pwsh-core # - current (local) time # - execution time of the previous command # - shortened PWD @@ -21,10 +20,6 @@ function prompt { - # Detect PS-Core - If ($PSVersionTable.PSEdition -eq 'Core') { - Write-Host '(Core) ' -NoNewLine - } # Current time $date = (Get-Date).ToString('HH:mm:ss') Write-Host -Object '[' -NoNewLine From 46db5d0f50aed4e76e41f9595a0d59b3548fdaee Mon Sep 17 00:00:00 2001 From: Alex Lopez Date: Tue, 10 Sep 2019 21:42:15 -0400 Subject: [PATCH 2/3] Revert "Update NewProfile.ps1" This reverts commit 323b9e88f7ea5e03b5c6ea3893ad4cd45b6324f5. --- Scripts/At_Your_Fingertips/NewProfile.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Scripts/At_Your_Fingertips/NewProfile.ps1 b/Scripts/At_Your_Fingertips/NewProfile.ps1 index 7fc2f05..d4f2608 100644 --- a/Scripts/At_Your_Fingertips/NewProfile.ps1 +++ b/Scripts/At_Your_Fingertips/NewProfile.ps1 @@ -8,6 +8,7 @@ # Added PowerShell-Core compatibility # # 1) PS prompt +# - detect pwsh-core # - current (local) time # - execution time of the previous command # - shortened PWD @@ -20,6 +21,10 @@ function prompt { + # Detect PS-Core + If ($PSVersionTable.PSEdition -eq 'Core') { + Write-Host '(Core) ' -NoNewLine + } # Current time $date = (Get-Date).ToString('HH:mm:ss') Write-Host -Object '[' -NoNewLine From 35095fbea71bc09aebe0ad2c31f9055f956dcfb5 Mon Sep 17 00:00:00 2001 From: Alex Lopez Date: Tue, 10 Sep 2019 21:46:44 -0400 Subject: [PATCH 3/3] Update NewProfile.ps1 Removed redundant display of (Core) in the console as it's displayed in the Title; minor cleanup. --- Scripts/At_Your_Fingertips/NewProfile.ps1 | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Scripts/At_Your_Fingertips/NewProfile.ps1 b/Scripts/At_Your_Fingertips/NewProfile.ps1 index d4f2608..a4b9f8d 100644 --- a/Scripts/At_Your_Fingertips/NewProfile.ps1 +++ b/Scripts/At_Your_Fingertips/NewProfile.ps1 @@ -8,7 +8,6 @@ # Added PowerShell-Core compatibility # # 1) PS prompt -# - detect pwsh-core # - current (local) time # - execution time of the previous command # - shortened PWD @@ -21,10 +20,6 @@ function prompt { - # Detect PS-Core - If ($PSVersionTable.PSEdition -eq 'Core') { - Write-Host '(Core) ' -NoNewLine - } # Current time $date = (Get-Date).ToString('HH:mm:ss') Write-Host -Object '[' -NoNewLine @@ -60,7 +55,7 @@ function prompt function Set-Title { # Running as Administrator or a regular user - If (($PSVersionTable.PSEdition -eq 'Core') -and ($IsWindows -eq 'True') -or ($PSVersionTable.PSEdition -ine 'Core')) + If (($PSEdition -eq 'Core') -and ($IsWindows -eq 'True') -or ($PSEdition -ine 'Core')) { $userInfo = [Security.Principal.WindowsIdentity]::GetCurrent() if ((New-Object Security.Principal.WindowsPrincipal $userInfo).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)) @@ -74,7 +69,7 @@ function Set-Title } # Usertype user@hostname - If (($PSVersionTable.PSEdition -eq 'Core') -and ($IsWindows -ine 'True')) { + If (($PSEdition -eq 'Core') -and ($IsWindows -ine 'True')) { $env:computername = hostname $user = "$($env:user)@$($env:computername)" }