Skip to content

Commit

Permalink
Merge pull request #315 from Augmentt-dev/sandbox
Browse files Browse the repository at this point in the history
Make PowershellGet optional
  • Loading branch information
merill authored Jul 11, 2024
2 parents 0a9c2a4 + be34e7f commit 552701f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions powershell/internal/ConvertTo-MtMaesterResults.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,22 @@ function ConvertTo-MtMaesterResult {
}
}

function GetMaesterLatestVersion() {
if (Get-Command 'Find-Module' -ErrorAction SilentlyContinue) {
return (Find-Module -Name Maester).Version
}

return 'Unknown'
}

$mgContext = Get-MgContext

$tenantId = $mgContext.TenantId
$tenantName = GetTenantName
$account = $mgContext.Account

$currentVersion = ((Get-Module -Name Maester).Version | Select-Object -Last 1).ToString()
$latestVersion = (Find-Module -Name Maester).Version
$latestVersion = GetMaesterLatestVersion

$mtTests = @()
$sortedTests = GetTestsSorted
Expand Down Expand Up @@ -115,4 +123,4 @@ function ConvertTo-MtMaesterResult {
}

return $mtTestResults
}
}

0 comments on commit 552701f

Please sign in to comment.