diff --git a/packages/powershell/oh-my-posh/oh-my-posh.psd1 b/packages/powershell/oh-my-posh/oh-my-posh.psd1 index 1beb8d94..c69e34fe 100644 --- a/packages/powershell/oh-my-posh/oh-my-posh.psd1 +++ b/packages/powershell/oh-my-posh/oh-my-posh.psd1 @@ -31,7 +31,7 @@ # Aliases to export from this module AliasesToExport = '*' # Functions to export from this module - FunctionsToExport = @('Get-PoshThemes', 'Set-PoshPrompt', 'Write-PoshTheme', 'Set-PoshContext') + FunctionsToExport = @('Get-PoshThemes', 'Set-PoshPrompt', 'Write-PoshTheme', 'Set-PoshContext', 'Get-PoshInfoForV2Users') # Private data to pass to the module specified in RootModule. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ diff --git a/packages/powershell/oh-my-posh/oh-my-posh.psm1 b/packages/powershell/oh-my-posh/oh-my-posh.psm1 index 01aa15f1..10271ea1 100644 --- a/packages/powershell/oh-my-posh/oh-my-posh.psm1 +++ b/packages/powershell/oh-my-posh/oh-my-posh.psm1 @@ -108,3 +108,31 @@ Register-ArgumentCompleter ` -CommandName Set-PoshPrompt ` -ParameterName Theme ` -ScriptBlock $function:ThemeCompletion + + +# V2 compatibility functions +# These should be removed at a certain point in time +# but to facilitate ease of transition they are kept +# as long as issues/feature requests keep popping up + +function Get-PoshInfoForV2Users { + Write-Host @' + +Hi there! + +It seems you're using an oh-my-posh V2 cmdlet while running V3. +To migrate your current setup to V3, have a look the documentation. + +https://ohmyposh.dev/docs/upgrading + +'@ +} + +Set-Alias -Name Set-Prompt -Value Get-PoshInfoForV2Users -Force +Set-Alias -Name Set-Theme -Value Get-PoshInfoForV2Users -Force +Set-Alias -Name Get-ThemesLocation -Value Get-PoshInfoForV2Users -Force +Set-Alias -Name Get-Theme -Value Get-PoshInfoForV2Users -Force +Set-Alias -Name Show-ThemeSymbols -Value Get-PoshInfoForV2Users -Force +Set-Alias -Name Show-ThemeColors -Value Get-PoshInfoForV2Users -Force +Set-Alias -Name Show-Colors -Value Get-PoshInfoForV2Users -Force +Set-Alias -Name Write-ColorPreview -Value Get-PoshInfoForV2Users -Force