diff --git a/src/Authentication/Authentication/Cmdlets/ConnectMgGraph.cs b/src/Authentication/Authentication/Cmdlets/ConnectMgGraph.cs index 9c16aed41f..df8a87742a 100644 --- a/src/Authentication/Authentication/Cmdlets/ConnectMgGraph.cs +++ b/src/Authentication/Authentication/Cmdlets/ConnectMgGraph.cs @@ -125,7 +125,7 @@ protected override void ProcessRecord() foreach (var innerException in aggregateException.Flatten().InnerExceptions) { var errorRecords = innerException.Data; - if (errorRecords.Count < 1) + if (errorRecords.Count > 1) { foreach (DictionaryEntry dictionaryEntry in errorRecords) { diff --git a/src/Authentication/Authentication/Cmdlets/InvokeMgGraphRequest.cs b/src/Authentication/Authentication/Cmdlets/InvokeMgGraphRequest.cs index 8ef56c42cb..b70922af3e 100644 --- a/src/Authentication/Authentication/Cmdlets/InvokeMgGraphRequest.cs +++ b/src/Authentication/Authentication/Cmdlets/InvokeMgGraphRequest.cs @@ -1205,7 +1205,7 @@ protected override void ProcessRecord() foreach (var innerException in aggregateException.Flatten().InnerExceptions) { var errorRecords = innerException.Data; - if (errorRecords.Count < 1) + if (errorRecords.Count > 1) { foreach (DictionaryEntry dictionaryEntry in errorRecords) { diff --git a/src/Authentication/Authentication/Microsoft.Graph.Authentication.csproj b/src/Authentication/Authentication/Microsoft.Graph.Authentication.csproj index 06915d200f..98f467d4de 100644 --- a/src/Authentication/Authentication/Microsoft.Graph.Authentication.csproj +++ b/src/Authentication/Authentication/Microsoft.Graph.Authentication.csproj @@ -1,6 +1,6 @@ - 1.2.0 + 1.3.0 7.1 netstandard2.0 Library diff --git a/src/Authentication/Authentication/Microsoft.Graph.Authentication.nuspec b/src/Authentication/Authentication/Microsoft.Graph.Authentication.nuspec index b1247787e6..4f486b6645 100644 --- a/src/Authentication/Authentication/Microsoft.Graph.Authentication.nuspec +++ b/src/Authentication/Authentication/Microsoft.Graph.Authentication.nuspec @@ -1,7 +1,7 @@ - 1.2.0 + 1.3.0 Microsoft.Graph.Authentication Microsoft Graph PowerShell authentication module Microsoft diff --git a/src/Authentication/Authentication/Microsoft.Graph.Authentication.psd1 b/src/Authentication/Authentication/Microsoft.Graph.Authentication.psd1 index 58b92e0a4f..c8d0d559d4 100644 --- a/src/Authentication/Authentication/Microsoft.Graph.Authentication.psd1 +++ b/src/Authentication/Authentication/Microsoft.Graph.Authentication.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft # -# Generated on: 23-Jan-21 +# Generated on: 1/27/2021 # @{ @@ -12,7 +12,7 @@ RootModule = './Microsoft.Graph.Authentication.psm1' # Version number of this module. -ModuleVersion = '1.2.0' +ModuleVersion = '1.3.0' # Supported PSEditions CompatiblePSEditions = 'Core', 'Desktop' diff --git a/src/Authentication/Authentication/test/Connect-MgGraph.Tests.ps1 b/src/Authentication/Authentication/test/Connect-MgGraph.Tests.ps1 new file mode 100644 index 0000000000..14c366d1d2 --- /dev/null +++ b/src/Authentication/Authentication/test/Connect-MgGraph.Tests.ps1 @@ -0,0 +1,14 @@ +BeforeAll { + $ModuleName = "Microsoft.Graph.Authentication" + $ModulePath = Join-Path $PSScriptRoot "..\$ModuleName.psd1" + Import-Module $ModulePath -Force +} +Describe 'Connect-MgGraph In Delegated Mode' { + It 'ShouldThrowExceptionWhenInvalidTenantIdIsSpecified' { + { Connect-MgGraph -TenantId "thisdomaindoesnotexist.com" -Scopes 'User.Read.All' -ErrorAction Stop } | Should -Throw -ExpectedMessage "*Tenant 'thisdomaindoesnotexist.com' not found*" + } + + It 'ShouldThrowExceptionWhenInvalidScopeIsSpecified' { + { Connect-MgGraph -Scopes 'User.Read.XYZ' -ErrorAction Stop } | Should -Throw -ExpectedMessage "*The scope 'User.Read.XYZ offline_access profile openid' does not exist*" + } +} \ No newline at end of file diff --git a/src/Authentication/Authentication/test/Authentication.Tests.ps1 b/src/Authentication/Authentication/test/Invoke-MgGraphRequest.Tests.ps1 similarity index 100% rename from src/Authentication/Authentication/test/Authentication.Tests.ps1 rename to src/Authentication/Authentication/test/Invoke-MgGraphRequest.Tests.ps1 diff --git a/src/Financials/Financials/readme.md b/src/Financials/Financials/readme.md index 19805f6101..07ad6fb52c 100644 --- a/src/Financials/Financials/readme.md +++ b/src/Financials/Financials/readme.md @@ -57,6 +57,6 @@ directive: ### Versioning ``` yaml -module-version: 1.2.0 +module-version: 1.3.0 release-notes: See https://aka.ms/GraphPowerShell-Release. ``` diff --git a/src/Notes/Notes/readme.md b/src/Notes/Notes/readme.md index 34f6d1e0db..9857b7b6b4 100644 --- a/src/Notes/Notes/readme.md +++ b/src/Notes/Notes/readme.md @@ -44,6 +44,6 @@ directive: ### Versioning ``` yaml -module-version: 1.2.0 +module-version: 1.3.0 release-notes: See https://aka.ms/GraphPowerShell-Release. ``` diff --git a/tools/GenerateModules.ps1 b/tools/GenerateModules.ps1 index 8f2871bd6e..fd6dab8ad7 100644 --- a/tools/GenerateModules.ps1 +++ b/tools/GenerateModules.ps1 @@ -127,7 +127,7 @@ $ModulesToGenerate | ForEach-Object -ThrottleLimit $ModulesToGenerate.Count -Par try { # Generate PowerShell modules. - & autorest --module-version:$ModuleVersion --service-name:$ModuleName $ModuleLevelReadMePath --verbose + & autorest --module-version:$ModuleVersion --service-name:$ModuleName $ModuleLevelReadMePath --version:"3.0.6306" --verbose if ($LASTEXITCODE) { Write-Error "Failed to generate '$ModuleName' module." }