diff --git a/profile.ps1 b/profile.ps1 index 57b058a..79c2506 100644 --- a/profile.ps1 +++ b/profile.ps1 @@ -9,9 +9,13 @@ $GitPromptSettings.AfterStatus = "" # Enable Chocolatey completions. Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" # Enable op completions. -Import-Module "$env:LOCALAPPDATA\1Password\cli\opProfile.psm1" +if (Test-Path "$env:LOCALAPPDATA\1Password\cli\opProfile.psm1") { + Import-Module "$env:LOCALAPPDATA\1Password\cli\opProfile.psm1" +} # Enable gh completions. -Invoke-Expression -Command $(gh completion -s powershell | Out-String) +if (Get-Command "gh" -ErrorAction SilentlyContinue) { + Invoke-Expression -Command $(gh completion -s powershell | Out-String) +} # Customize PowerShell prompt. function Prompt {