1

I have two versions of PowerShell installed on my Windows 10 desktop - Windows PowerShell (5.1) and PowerShell core (7.1.3).

I've installed the Microsoft.Online.SharePoint.Powershell module (version 16.0.21213.12000) in both environments. However, I'm not able to connect from PowerShell core. I get the error " The term 'connect-sposervice' is not recognized as a name of a cmdlet..."

It will work if I explicitly import the module using the -UseWindowsPowerShell parameter. This displays a number of warnings about unapproved verbs.

I can't find any information on whether the Microsoft.Online.SharePoint.Powershell module is supported in PowerShell core or not. Is this an issue with my environment? Should I stick to using Windows PowerShell for now?

1 Answer 1

2

The SharePoint Online PowerShell module can compatible with PowerShell 7(core) .

Note: Minimum PowerShell version--PowerShell 2.0

enter image description here

You can refer to the below posts:

2
  • 1
    Thanks @EchoDu_MSFT, the second article link that you provided also says that you need to use the -UseWindowsPowerShell switch when using PowerShell Core. I can see where it mentions the minimum version of PowerShell, but it doesn't indicate if it is supported in PowerShell core. From what I have read so far, it sounds like the Microsoft.Online.SharePoint.PowerShell module must be run in compatibility mode to work in PowerShell Core Commented May 31, 2021 at 23:09
  • Hi, Ivan Wilson. Yes, you are right. Commented Jun 1, 2021 at 2:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.