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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (3,056)