JanDeDobbeleer / oh-my-posh2

A prompt theming engine for Powershell
MIT License
5.19k stars 284 forks source link

PS Core 7: The term 'Set-Theme' is not recognized #335

Closed WizX20 closed 3 years ago

WizX20 commented 3 years ago

image

function Test-IsVanillaWindow {
    if($env:PROMPT -or $env:ConEmuANSI) {
        # Console
        return $false
    }
    elseif ($env:TERM_PROGRAM -eq "Hyper") {
        # Hyper.is
        return $false
    }
    elseif ($env:TERM_PROGRAM -eq "vscode") {
        # Visual Studio Code 
        return $false
    }
    else {
        # Powershell
        return $true
    }
}

$v = Test-IsVanillaWindow

Write-Output $v

Import-Module PSReadLine
Set-PSReadlineOption -BellStyle None
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward

Write-Output 'Loading Choco Profile'
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
  Import-Module "$ChocolateyProfile"
}

Write-Output 'Loading Posh Modules'
Import-Module posh-git
Import-Module oh-my-posh

Write-Output 'Setting Theme'
#$ThemeSettings.GitSymbols.BranchSymbol = [char]::ConvertFromUtf32(0xE0A0)
#Set Theme Paradox
Set-Theme Operator
JanDeDobbeleer commented 3 years ago

V3 changed the cmdlet names to no longer conflict with others. Have a look here for more context.