From e3d4f1d014e2898f3de39f577b101a475fcea847 Mon Sep 17 00:00:00 2001 From: Andres Bohren <45082822+BohrenAn@users.noreply.github.com> Date: Sat, 3 Feb 2024 10:38:01 +0100 Subject: [PATCH 1/2] Update Test-MgCommandPrerequisites.ps1 Find-MgGraphCommand with API Version "beta" does not return anything. Therefore the Test-MgCommandPrerequisites Fails --- src/internal/Test-MgCommandPrerequisites.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/internal/Test-MgCommandPrerequisites.ps1 b/src/internal/Test-MgCommandPrerequisites.ps1 index bfb5b84..bea8c9a 100644 --- a/src/internal/Test-MgCommandPrerequisites.ps1 +++ b/src/internal/Test-MgCommandPrerequisites.ps1 @@ -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, @@ -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 "*}" From 90ec50677ba63afd448e7ef82e7a09234465135c Mon Sep 17 00:00:00 2001 From: Matthew Flanagan <188046+mattimustang@users.noreply.github.com> Date: Wed, 28 Feb 2024 14:19:10 +1100 Subject: [PATCH 2/2] Fixed typo in Export-MsIdAppConsentGrantReport.ps1 documentation Fixed typo in 'MgGragh' to 'MgGraph' --- src/Export-MsIdAppConsentGrantReport.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Export-MsIdAppConsentGrantReport.ps1 b/src/Export-MsIdAppConsentGrantReport.ps1 index 62e850a..957db2b 100644 --- a/src/Export-MsIdAppConsentGrantReport.ps1 +++ b/src/Export-MsIdAppConsentGrantReport.ps1 @@ -8,7 +8,7 @@ .EXAMPLE PS > Install-Module ImportExcel - PS > Connect-MgGragh -Scopes Directory.Read.All + PS > Connect-MgGraph -Scopes Directory.Read.All PS > Export-MsIdAppConsentGrantReport -ReportOutputType ExcelWorkbook -ExcelWorkbookPath .\report.xlsx Output a report in Excel format