I'm trying to find the best way to connect to SharePoint from my Mac using PowerShell and VS Code, especially since my account has multi-factor authentication (MFA). I've attempted to keep a notes page with connection commands, but I find that I don't use PowerShell often enough. When I do use it, the commands feel outdated. Can anyone share the correct commands or point me to a resource?
I've created applications in Entra, but I keep facing issues like a verification loop when executing commands such as: Connect-PnPOnline -Url "https://domain.sharepoint.com" -DeviceLogin -ClientId "". It's frustrating because I probably waste a day each month trying to establish these connections. Is there a master list of reliable commands?
4 Answers
What errors are you getting? Share the command and the error message so we can help you troubleshoot.
The command interface can feel dated at times, yes. You're not alone on that one!
Have you tried different login methods? Besides `-Interactive` and `-DeviceLogin`, there are other options like `-OSLogin` and various token and certificate methods. The [documentation](https://pnp.github.io/powershell/articles/authentication.html) has a good overview of these.
You might want to try using the interactive login method instead:
```
Connect-PnPOnline -Url "https://domain.sharepoint.com" -Interactive -ClientId ""
```
Check out the [official documentation](https://pnp.github.io/powershell/articles/authentication.html) for more options.

Related Questions
How To Get Your Domain Unblocked From Facebook
How To Find A String In a Directory of Files Using Linux