Details
If the Documents folder is in OneDrive, the CTT profile is not able to load the proper Oh-My-Posh config and returns an error. Probably also happens for Powershell 5 now (untested).
Suggested fix based on old version:
line 3 onwards
function Get-ProfileDir {
if ($PSVersionTable.PSEdition -eq "Core") {
return [Environment]::GetFolderPath("MyDocuments") + "\PowerShell"
} elseif ($PSVersionTable.PSEdition -eq "Desktop") {
return [Environment]::GetFolderPath("MyDocuments") + "\WindowsPowerShell"
} else {
Write-Error "Unsupported PowerShell edition: $($PSVersionTable.PSEdition)"
return $null
}
}
$profileDir = Get-ProfileDir
oh-my-posh init pwsh --config $profileDir\cobalt2.omp.json | Invoke-Expression
Details
If the Documents folder is in OneDrive, the CTT profile is not able to load the proper Oh-My-Posh config and returns an error. Probably also happens for Powershell 5 now (untested).
Suggested fix based on old version:
line 3 onwards