Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 22484

Cant load a particular module in Powershell

$
0
0

I am trying to use[Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext] as follows:

$authContext =   [Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext]$authUrl

I have run:

 Install-Module -Name AzureAD -AllowClobber

then:

 Import-Module -Name AzureAD

But I keep getting the error:

Unable to find type [Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext].

Any ideas on how I can fix this ?

Update:

  $authUrl = "https://login.windows.net/${tenantId}"  $authContext =   [Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext ]$authUrl$cred = New-Object Microsoft.IdentityModel.Clients.ActiveDirectory.ClientCredential $applicationId,$key

Viewing all articles
Browse latest Browse all 22484

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>