PowerShell Connect-SPOService No valid OAuth 2.0 authenticaton session exists
I have been using PowerShell 7 and SharePoint Online Management Shell for months.
I tried a few weeks ago and got an error when I was trying to go to Connect-SPOService -Url https://TENANTNAMEHERE -admin.sharepoint.com
I had PIM in with SharePoint Administrator RBAC as I had done before.
Now I get an error
WARNING: Unable to load DLL 'msalruntime': The specified module could not be found. (Exception from HRESULT: Ox8007007E)
I uninstalled the SharePoint Online Management Shell and restarted and ran sfc and DISM checks and restarted.
I AM able to get it to work if I tell it to go to the web browser yet not with the msalruntime where it is unable to load the DLL. I don't know if I should try to install this on another system and copy the DLL yet I would think with a fresh install it would write the DLL.
Windows PowerShell
Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\WINDOWS\svstem32> Import-Module Microsoft.Online.SharePoint.PowerShell
PS C:\WINDOWS\svstem32> Connect-SPOService -Url https://TENANTNAMEHERE-admin.sharepoint.com
WARNING: Unable to load DLL 'msalruntime': The specified module could not be found. (Exception from HRESULT: Ox8007007E) See https:/ aka.ms msal-net-wam#troubleshooting
Connect-SPOService : No valid OAuth 2.0 authentication session exists
At line:1 char:1
+ Connect-SPOService -url https://TENANTNAMEHERE-admin.sharepoint.com
+--------
CategoryInto : NotSpecified: (:) [Connect-SPOService], AuthenticationException
+FullyQualifiedErrorId : Microsoft.Online.SharePoint.PowerShell.AuthenticationException,Microsoft.Online.SharePoint.PowerShell.ConnectSPOService
PS C: \WINDoWS\svstem32>