fix(pwsh): alert when we can't download dependencies

resolves #1382
This commit is contained in:
Jan De Dobbeleer 2021-12-09 00:13:30 +01:00 committed by Jan De Dobbeleer
parent d9e642a132
commit adb49d1cd0

View file

@ -113,8 +113,21 @@ function Sync-PoshArtifacts {
Sync-PoshThemes -Version $Version
}
$moduleVersion = Split-Path -Leaf $MyInvocation.MyCommand.ScriptBlock.Module.ModuleBase
Sync-PoshArtifacts -Version $moduleVersion
try {
$moduleVersion = Split-Path -Leaf $MyInvocation.MyCommand.ScriptBlock.Module.ModuleBase
Sync-PoshArtifacts -Version $moduleVersion
}
catch {
$message = @'
Oh My Posh is unable to download and store the latest version.
In case you installed using AllUsers and are a non-admin user,
please run the following command as an administrator:
Import-Module oh-my-posh
'@
Write-Error $message
exit 1
}
# Legacy functions