Skip to content

Commit 0e5d653

Browse files
Address auth ALC review comments
1 parent 3a55148 commit 0e5d653

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

src/Authentication/Authentication/Microsoft.Graph.Authentication.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace Microsoft.Graph.PowerShell.Authentication.Loader
5353
5454
private static Assembly Resolve(AssemblyLoadContext context, AssemblyName assemblyName)
5555
{
56-
if (context == null || assemblyName == null)
56+
if (context == null || assemblyName == null || string.IsNullOrWhiteSpace(assemblyName.Name))
5757
{
5858
return null;
5959
}
@@ -91,7 +91,7 @@ function Import-GraphAuthenticationAssembly {
9191
)
9292

9393
if ($PSEdition -ne 'Core' -or -not ('System.Runtime.Loader.AssemblyLoadContext' -as [type])) {
94-
return Import-Module -Name $ModulePath -PassThru
94+
return Import-Module -LiteralPath $ModulePath -PassThru
9595
}
9696

9797
$loadContextName = Get-GraphAuthenticationLoadContextName -ModulePath $ModulePath

src/Authentication/Authentication/test/Microsoft.Graph.Authentication.Tests.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,7 @@ public static class GraphAuthenticationAssemblyLoadContextTestHelper
117117

118118
$dependencyAssembly.GetName().Name | Should -Be 'Azure.Core'
119119
$dependencyContext.Name | Should -Be $loadContext.Name
120-
[System.Runtime.Loader.AssemblyLoadContext]::Default.Assemblies |
121-
Where-Object { $_.GetName().Name -eq 'Azure.Core' } |
122-
Should -BeNullOrEmpty
120+
[object]::ReferenceEquals($dependencyContext, [System.Runtime.Loader.AssemblyLoadContext]::Default) | Should -BeFalse
123121
}
124122
}
125123
}

0 commit comments

Comments
 (0)