Forum Discussion
Bikash Maharjan
Jul 10, 2020Copper Contributor
PowerShell connection from MacOS not working
I trying PowerShell 7 on MacOS and I have installed SharePoint Online Management Shell but the "Connect-SPOService" command is not found. Get-Module SharePointPnPPowerShell* -ListAvailable | Sel...
TuaRes-IT
Jul 22, 2020Copper Contributor
Hi Bikash Maharjan , I run into the same or at least similar problem. Let me first explain why I want to use PowerShell end then explain the problem that I ran into (similar to your problem).
I don't have a PC, I work with a MacBookPro. What I want to do is setup scripts with help of PowerShell, to create Team sites with Teams plus a few dedicated Lists which I need to provide to customers in order to allow a PowerApp read/write data on that list.
Using latest OSX, I wanted to set up PowerShell for MacOS. Following all provided information in Microsoft Help docs:
- installed HomeBrew (succes),
- installed PowerShell v 7 (succes)
- imported various modules:
- Teams (Succes)
- AZ (Succes)
Microsoft.Online.SharePoint.PowerShell (???).
If I then run a get-help on 'connect*' I get:
Connect-AzAccount from module Az.Accounts
Connect-MicrosoftTeams from module MicrosoftTeams
So, apparently, while there is no sign that the SPO module was not successfully imported, it is not possible to connect to SPO. Hence when I run (with the variables set to the correct values)
"Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential"
I get the response:
"Connect-SPOService: The term 'Connect-SPOService' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."
Now... what to do next? I already repeated the entire installation: no effect. So now I think about setting up PowerShell though Azure. Do you or anyone else have an idea how to do that? Help is much appreciated!