refactor: check for availability of posh-git iso cmdlet

resolves #325
This commit is contained in:
Jan De Dobbeleer 2021-01-07 13:17:06 +01:00 committed by Jan De Dobbeleer
parent c57368ce7d
commit 598984b4cb
2 changed files with 2 additions and 2 deletions

View file

@ -27,7 +27,7 @@ if ($PSVersionTable.PSEdition -eq "Core" -and !$IsWindows) {
function Set-PoshContext {}
function Set-GitStatus {
if (Get-Command -Name "Get-GitStatus" -ErrorAction SilentlyContinue) {
if (Get-Module -Name "posh-git") {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSProvideCommentHelp', '', Justification='Variable used later(not in this scope)')]
$Global:GitStatus = Get-GitStatus
}

View file

@ -8,7 +8,7 @@ if (Test-Path "::CONFIG::") {
function Set-PoshContext {}
function Set-GitStatus {
if (Get-Command -Name "Get-GitStatus" -ErrorAction SilentlyContinue) {
if (Get-Module -Name "posh-git") {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSProvideCommentHelp', '', Justification='Variable used later(not in this scope)')]
$Global:GitStatus = Get-GitStatus
}