This doesn't seem to work on PowerShell 7.
Can we get clarification on what versions of PowerShell are supported?
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@ADNewsom09 Thank you for your query. We will investigate and update the thread further.
@ADNewsom09 You are correct , We verified this and this is due to the Azure AD module using some assemblies which are not supported in .net Core on which Powershell 7 is based.
PS C:\Program Files\PowerShell\7> Install-module azuread
PS C:\Program Files\PowerShell\7> Import-module azuread
PS C:\Program Files\PowerShell\7> Get-Module azuread
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Binary 2.0.2.76 azuread {Add-AzureADApplicationOwner, Add-AzureADDeviceRe…
PS C:\Program Files\PowerShell\7> connect-azureAD
Connect-AzureAD: One or more errors occurred. (Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.): Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Connect-AzureAD: One or more errors occurred. (Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.)
Connect-AzureAD: Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Connect-AzureAD: One or more errors occurred. (Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.): Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
PS C:\Program Files\PowerShell\7>
Powershell/Powershell#10473
Powershell/Powershell#11070
I have reported this internally and will update once I get a response. In the meantime I have added a note on the article and requested a review from the content authors . Once that is reviewed , it will be published accordingly.
Thank you.
@shashishailaj This has been reported internally and it is being worked on . This will take some time to be fixed . AS of now the workaround is to use the Azure Powershell 5.x with Azure AD powershell module which is present on your machine by default . Powershell 7 provides a different module which interfaces with .net Core however Powershell 5.x interfaces with full .net framework and hence will work properly . We are trying to bring the Azure AD powershell to linux and MacOS platforms as well in its entirety . Please keep checking the feedback item . I believe it will be same for all the platforms when it comes out because the larger goal is to run all the powershell modules on .net Core which is going to e the future of .net . As of now I have added a note and it will be updated on teh article after review and no further action on this can be taken . Hence we are closing this issue. Should you have any further queries, please feel free to tag me to your reply .
Thank you.
Most helpful comment
@ADNewsom09 You are correct , We verified this and this is due to the Azure AD module using some assemblies which are not supported in .net Core on which Powershell 7 is based.
Powershell/Powershell#10473
Powershell/Powershell#11070
I have reported this internally and will update once I get a response. In the meantime I have added a note on the article and requested a review from the content authors . Once that is reviewed , it will be published accordingly.
Thank you.