cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
robcaretta
Regular Visitor

Add-PowerAppsAccount - System.Security.Cryptography.SHA256Cng

I could really use some assistance with this module. I have the latest versions of Powershell 7.1.3, VS Code 1.57.1 , VS Code powershell extension 2021.6.2, and the latest version of Microsoft.PowerApps.Administration.PowerShell.

 

I can not for the life of my figure out how to authenticate with this module using this combination of technology.

 

When I run Add-PowerAppsAccount I receive the error message Add-PowerAppsAccount: Exception calling "AcquireToken" with "4" argument(s): "Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxx'."

 

Could you advise on what I am missing, or doing wrong?

Thanks,
Rob

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisPiasecki
Super User
Super User

Hi @robcaretta,

 

You'll need to use Windows PowerShell with the PowerApps modules, the System.Net.Cryptography DLL that it depends on is built on .NET Framework, whereas PowerShell 7 is built on .Net Core. More information below:

 

https://docs.microsoft.com/en-us/power-platform/admin/powerapps-powershell#requirements

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

View solution in original post

2 REPLIES 2
ChrisPiasecki
Super User
Super User

Hi @robcaretta,

 

You'll need to use Windows PowerShell with the PowerApps modules, the System.Net.Cryptography DLL that it depends on is built on .NET Framework, whereas PowerShell 7 is built on .Net Core. More information below:

 

https://docs.microsoft.com/en-us/power-platform/admin/powerapps-powershell#requirements

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

View solution in original post

robcaretta
Regular Visitor

Thanks for the prompt response.  I understand now, I can switch VS Code back to 5.1. Was hoping to start using more modern PS tooling but apparently can't.  Frustrating.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,571)