Skip to content

Commit

Permalink
Merge pull request #40 from BohrenAn/patch-1
Browse files Browse the repository at this point in the history
Update Test-MgCommandPrerequisites.ps1
  • Loading branch information
merill authored May 23, 2024
2 parents b43a9cd + e3d4f1d commit 2fdc895
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/internal/Test-MgCommandPrerequisites.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Test-MgCommandPrerequisites {
# The service API version.
[Parameter(Mandatory = $false, Position = 2)]
[ValidateSet('v1.0', 'beta')]
[string] $ApiVersion = 'beta',
[string] $ApiVersion = 'v1.0',
# Specifies a minimum version.
[Parameter(Mandatory = $false)]
[version] $MinimumVersion,
Expand Down Expand Up @@ -47,8 +47,9 @@ function Test-MgCommandPrerequisites {
foreach ($CommandName in $Name) {
[array] $MgCommands = Find-MgGraphCommand -Command $CommandName -ApiVersion $ApiVersion

$MgCommand = $MgCommands[0]

if ($MgCommands.Count -gt 1) {
$MgCommand = $MgCommands[0]
## Resolve from multiple results
[array] $MgCommandsWithPermissions = $MgCommands | Where-Object Permissions -NE $null
[array] $MgCommandsWithListPermissions = $MgCommandsWithPermissions | Where-Object URI -NotLike "*}"
Expand Down

0 comments on commit 2fdc895

Please sign in to comment.