PowerShell connection from MacOS not working

%3CLINGO-SUB%20id%3D%22lingo-sub-1514831%22%20slang%3D%22en-US%22%3EPowerShell%20connection%20from%20MacOS%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1514831%22%20slang%3D%22en-US%22%3E%3CP%3EI%20trying%20PowerShell%207%20on%20MacOS%20and%20I%20have%20installed%20SharePoint%20Online%20Management%20Shell%20but%20the%20%22%3CSPAN%3EConnect-SPOService%22%20command%20is%20not%20found.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGet-Module%20SharePointPnPPowerShell*%20-ListAvailable%20%7C%20Select-Object%20Name%2CVersion%20%7C%20Sort-Object%20Version%20-Descending%3C%2FP%3E%3CP%20class%3D%22p1%22%3E%3CSPAN%20class%3D%22s1%22%3EMicrosoft.Online.SharePoint.PowerShell%2016.0.20017.12000%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1514831%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1515005%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20connection%20from%20MacOS%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1515005%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F35909%22%20target%3D%22_blank%22%3E%40Bikash%20Maharjan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20found%20that%20my%20attempts%20to%20get%20PowerShell%20to%20work%20on%20MacOS%20have%20resulted%20in%20limited%20success.%26nbsp%3B%20Each%20time%20I%20try%20it%2C%20there%20seems%20to%20be%20slightly%20more%20functionality%2C%20but%20it%20really%20has%20a%20long%20way%20to%20go.%26nbsp%3B%20It's%20too%20frustrating%20at%20the%20moment%20to%20try%20and%20make%20it%20work%2C%20so%20for%20any%20PowerShell%20I%20just%20revert%20to%20my%20Windows%2010%20device%20for%20the%20time%20being.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1516673%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20connection%20from%20MacOS%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1516673%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F616707%22%20target%3D%22_blank%22%3E%40PeterRising%3C%2FA%3E%26nbsp%3BThanks%20for%20confirmation%20-%20I%20was%20wondering%20if%20it%20was%20just%20my%20setup.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1537798%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20connection%20from%20MacOS%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1537798%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F35909%22%20target%3D%22_blank%22%3E%40Bikash%20Maharjan%3C%2FA%3E%26nbsp%3B%2C%20I%20run%20into%20the%20same%20or%20at%20least%20similar%20problem.%20Let%20me%20first%20explain%20why%20I%20want%20to%20use%20PowerShell%20end%20then%20explain%20the%20problem%20that%20I%20ran%20into%20(similar%20to%20your%20problem).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22s1%22%3EI%20don't%20have%20a%20PC%2C%20I%20work%20with%20a%20MacBookPro.%20What%20I%20want%20to%20do%20is%20setup%20scripts%20with%20help%20of%20PowerShell%2C%20to%20create%20Team%20sites%20with%20Teams%20plus%20a%20few%20dedicated%20Lists%20which%20I%20need%20to%20provide%20to%20customers%20in%20order%20to%20allow%20a%20PowerApp%20read%2Fwrite%20data%20on%20that%20list.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUsing%20latest%20OSX%2C%20I%20wanted%20to%20set%20up%20PowerShell%20for%20MacOS.%20Following%20all%20provided%20information%20in%20Microsoft%20Help%20docs%3A%3C%2FP%3E%3CP%3E-%20installed%20HomeBrew%20(succes)%2C%3C%2FP%3E%3CP%3E-%20installed%20PowerShell%20v%207%20(succes)%3C%2FP%3E%3CP%3E-%20imported%20various%20modules%3A%3C%2FP%3E%3CUL%3E%3CLI%3ETeams%20(Succes)%3C%2FLI%3E%3CLI%3EAZ%20(Succes)%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22p1%22%3E%3CSPAN%20class%3D%22s1%22%3EMicrosoft.Online.SharePoint.PowerShell%20(%3F%3F%3F).%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSPAN%20class%3D%22s1%22%3EIf%20I%20then%20run%20a%20get-help%20on%20'connect*'%20I%20get%3A%3C%2FSPAN%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%20class%3D%22p1%22%3E%3CSPAN%20class%3D%22s1%22%3EConnect-AzAccount%20from%20module%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22s1%22%3EAz.Accounts%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22p1%22%3E%3CSPAN%20class%3D%22s1%22%3EConnect-MicrosoftTeams%20from%20module%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22s1%22%3EMicrosoftTeams%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSPAN%20class%3D%22s1%22%3ESo%2C%20apparently%2C%20while%20there%20is%20no%20sign%20that%20the%20SPO%20module%20was%20not%20successfully%20imported%2C%20it%20is%20not%20possible%20to%20connect%20to%20SPO.%20Hence%20when%20I%20run%20(with%20the%20variables%20set%20to%20the%20correct%20values)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22s1%22%3E%22%3C%2FSPAN%3E%3CFONT%20color%3D%22%230000FF%22%3E%3CSPAN%20class%3D%22s1%22%3EConnect-SPOService%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22s3%22%3E-Url%3C%2FSPAN%3E%3CSPAN%20class%3D%22s2%22%3E%20https%3A%2F%2F%3C%2FSPAN%3E%3CSPAN%20class%3D%22s4%22%3E%24orgName%3C%2FSPAN%3E%3CSPAN%20class%3D%22s2%22%3E-admin.sharepoint.com%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22s3%22%3E-Credential%3C%2FSPAN%3E%20%3C%2FFONT%3E%3CSPAN%20class%3D%22s4%22%3E%3CFONT%20color%3D%22%230000FF%22%3E%24userCredential%3C%2FFONT%3E%22%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22s4%22%3EI%20get%20the%20response%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22p1%22%3E%3CSPAN%20class%3D%22s1%22%3E%22%3CFONT%20color%3D%22%23FF0000%22%3EConnect-SPOService%3A%20The%20term%20'Connect-SPOService'%20is%20not%20recognized%20as%20the%20name%20of%20a%20cmdlet%2C%20function%2C%20script%20file%2C%20or%20operable%20program.%26nbsp%3B%3C%2FFONT%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22s1%22%3E%3CFONT%20color%3D%22%23FF0000%22%3ECheck%20the%20spelling%20of%20the%20name%2C%20or%20if%20a%20path%20was%20included%2C%20verify%20that%20the%20path%20is%20correct%20and%20try%20again.%3C%2FFONT%3E%22%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22p1%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22p1%22%3E%3CSPAN%20class%3D%22s1%22%3ENow...%20what%20to%20do%20next%3F%20I%20already%20repeated%20the%20entire%20installation%3A%20no%20effect.%20So%20now%20I%20think%20about%20setting%20up%20PowerShell%20though%20Azure.%20Do%20you%20or%20anyone%20else%20have%20an%20idea%20how%20to%20do%20that%3F%20Help%20is%20much%20appreciated!%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1797347%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20connection%20from%20MacOS%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1797347%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F35909%22%20target%3D%22_blank%22%3E%40Bikash%20Maharjan%3C%2FA%3E%26nbsp%3BI%20have%20spent%20several%20hours%20attempting%20to%20get%20this%20to%20work%2C%20to%20come%20to%20the%20same%20conclusion%3A%20the%20Install-Module%20command%20seems%20to%20work%2C%20but%20then%20doesn't%20seem%20to%20actually%20install%20what's%20needed.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20less%20than%205%20minutes%2C%20I%20fired%20up%20Parallels%20and%20had%20everything%20working%20in%20Windows%2010%2C%20doing%20exactly%20the%20same%20thing%20I%20was%20attempting%20in%20MacOS.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20some%20technical%20problem%20to%20be%20fixed%20by%20Microsoft%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1801343%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20connection%20from%20MacOS%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1801343%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F838387%22%20target%3D%22_blank%22%3E%40Jamesr2049%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20is%20more%20something%20for%20Apple%20to%20fix%20than%20Microsoft%20I%20think.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1830831%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20connection%20from%20MacOS%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1830831%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F616707%22%20target%3D%22_blank%22%3E%40PeterRising%3C%2FA%3E%26nbsp%3BIndeed%2C%20Peter%2C%20I%20had%20the%20same%20problem%2C%20but%20at%20some%20point%20was%20informed%20by%20someone%20from%20PowerShell%20development%20that%20this%20is%20indeed%20not%20working.%20So%2C%20I%20made%20my%20Mac%20dual%20boot%20and%20installed%20a%20full%20Windows%2010%20using%20Bootcamp.%20Works%20perfect.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2117129%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20connection%20from%20MacOS%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2117129%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F35909%22%20target%3D%22_blank%22%3E%40Bikash%20Maharjan%3C%2FA%3E%26nbsp%3BI%20just%20tried%20it%20again%20with%20Powershell%20installed%20via%20homebrew.%20I%20can%20install%20the%20Module%26nbsp%3BMicrosoft.Online.SharePoint.PowerShell%20and%20after%20exiting%20Powershell%20and%20running%20it%20again%20I%20get%20a%20full%20list%20of%20commands.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%22Powershell%20Commandlets.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F253109i737353B9B28AF7E8%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Powershell%20Commandlets.png%22%20alt%3D%22Powershell%20Commandlets.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EUnfortunately%20logging%20in%20results%20in%20an%20error%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EConnect-SPOService%3A%20The%20type%20initializer%20for%20'Microsoft.Win32.Registry'%20threw%20an%20exception.%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%22Powershell%20Mac%20connection%20attempt.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F253108i57F556E9570F04D0%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Powershell%20Mac%20connection%20attempt.png%22%20alt%3D%22Powershell%20Mac%20connection%20attempt.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EWell%20of%20course.%20There%20is%20no%20Win32.Registry%20on%20my%20Mac.%20Seems%20like%20there%20are%20still%20dependencies%20to%20Windows%20machines%20left.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2117401%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20connection%20from%20MacOS%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2117401%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F30678%22%20target%3D%22_blank%22%3E%40Thomas%20Weiss%3C%2FA%3E%26nbsp%3Band%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F35909%22%20target%3D%22_blank%22%3E%40Bikash%20Maharjan%3C%2FA%3E%26nbsp%3BOn%20trying%20to%20use%20PowerShell%20from%20MacOSX%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20experience%3A%20PowerShell%20Core%20works%20on%20OSX%20in%20the%20sense%20that%20the%20software%20runs%20and%20that%20you%20can%20use%20a%20few%20modules%2C%20like%20Teams.%20Butyou%20simply%20cannot%20do%20anything%20'serious'%20with%20PowerShell%20Core%20on%20a%20Mac.%20Too%20many%20modules%20(while%20they%20do%20install)%20simply%20do%20not%20work%20from%20Mac%20OSX%2C%20for%20the%20reason%20that%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F30678%22%20target%3D%22_blank%22%3E%40Thomas%20Weiss%3C%2FA%3E%26nbsp%3B%20mentioned.%20Even%20while%20many%20%22e-learning%20books%22%20claim%20that%20functionalities%20work%20with%20the%20PowerShell%20Core%20from%20a%20Mac%20(even%20documented%20with%20screenshots)%3A%20they%20do%20not%20work.%20I%20talked%20to%20many%20people%2C%20and%20contacted%20a%20famous%20PnP%20programmer%2C%20they%20clearly%20stated%20that%20a%20lot%20if%20not%20most%20modules%20will%20not%20work%20from%20a%20Mac.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20advise%2C%20if%20you%20are%20Mac%20user%20with%20a%20need%2Fwish%20to%20work%20with%20Powershell%3A%3C%2FP%3E%3CP%3E-%20Use%20Bootcamp%20on%20your%20Mac%20to%20set%20up%20a%20lean%20Window%20partition%3B%20so%20you%20will%20get%20a%20truly%20native%20Windows%20installation)%3B%20switching%20between%20OSX%20and%20WIN10%20required%20a%20restart%2C%20but%20that%20takes%20a%20little%20of%20your%20time%2C%20like%2010%20seconds.%3C%2FP%3E%3CP%3E-%20download%20a%20Windows%2010%20installation%20from%20Microsoft.%20You%20are%20allowed%20to%20use%20it%20for%20a%20while%20without%20activation%20of%20the%20licence%3B%20at%20the%20end%20I%20preferred%20activating%20the%20licence%2C%20Windows%2010%20is%20worth%20its%20money%20(while%20I%20maintain%20convinced%20that%20MacOS%20is%20the%20better%20OS).%3C%2FP%3E%3CP%3E-%20then%20install%20the%20Windows%20PowerShell%20on%20your%20Windows%20%26nbsp%3Baccount%20(running%20natively%20on%20your%20Mac).%20Install%20Windows%20PowerShell%205.1%3B%20%26nbsp%3Bthe%20version%20where%20you%20see%20so%20many%20blogs%20and%20docs%20advising%20NOT%20to%20use%20it.%20But%20the%20point%20is%2C%20this%20Powershell%20version%20does%20everything%20you%20expect%2C%20it%20has%20a%20nice%2C%20very%20user-friendly%20interface%20as%20well.%20Use%20any%20of%20your%20OneDrive%20accounts%20to%20store%20scripts%2C%20so%20you%20can%20also%20look%20at%20them%20from%20your%20OSX%20environment.%3C%2FP%3E%3CP%3E-%20also%20install%20Visual%20Studio%20Code%20as%20well%20(you%20can%20also%20do%20this%20on%20your%20Mac%2C%20but%20...%20without%20the%20Cmdlets%20not%20working%2C%20you%20would%20do%20that%20is%20you%20want%20to%20use%20other%20features%2C%20like%20help%20with%20your%20JSON%20code).%3C%2FP%3E%3CP%3ESucces!!!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2165757%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20connection%20from%20MacOS%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2165757%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F691463%22%20target%3D%22_blank%22%3E%40Bernd_Kroon%3C%2FA%3E%26nbsp%3BI%20tested%20again%20and%20at%20least%20the%20Combination%20Powershell%207%20and%20the%20modern%20PnP.Powershell%20Module%20work%20successfully%20with%20the%20device%20login%20option%20when%20logging%20in.%20SharePoint%20Online%20management%20shell%20is%20still%20broken.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

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 | Select-Object Name,Version | Sort-Object Version -Descending

Microsoft.Online.SharePoint.PowerShell 16.0.20017.12000

9 Replies

@Bikash Maharjan 

 

I have found that my attempts to get PowerShell to work on MacOS have resulted in limited success.  Each time I try it, there seems to be slightly more functionality, but it really has a long way to go.  It's too frustrating at the moment to try and make it work, so for any PowerShell I just revert to my Windows 10 device for the time being.

@PeterRising Thanks for confirmation - I was wondering if it was just my setup. 

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! 

@Bikash Maharjan I have spent several hours attempting to get this to work, to come to the same conclusion: the Install-Module command seems to work, but then doesn't seem to actually install what's needed.

 

In less than 5 minutes, I fired up Parallels and had everything working in Windows 10, doing exactly the same thing I was attempting in MacOS.

 

Is there some technical problem to be fixed by Microsoft?

@Jamesr2049 

 

This is more something for Apple to fix than Microsoft I think.

@PeterRising Indeed, Peter, I had the same problem, but at some point was informed by someone from PowerShell development that this is indeed not working. So, I made my Mac dual boot and installed a full Windows 10 using Bootcamp. Works perfect.

@Bikash Maharjan I just tried it again with Powershell installed via homebrew. I can install the Module Microsoft.Online.SharePoint.PowerShell and after exiting Powershell and running it again I get a full list of commands.

 

Powershell Commandlets.png

Unfortunately logging in results in an error:

 

 

Connect-SPOService: The type initializer for 'Microsoft.Win32.Registry' threw an exception.

 

 

Powershell Mac connection attempt.png

Well of course. There is no Win32.Registry on my Mac. Seems like there are still dependencies to Windows machines left.

 

@Thomas Weiss and @Bikash Maharjan On trying to use PowerShell from MacOSX:

 

My experience: PowerShell Core works on OSX in the sense that the software runs and that you can use a few modules, like Teams. Butyou simply cannot do anything 'serious' with PowerShell Core on a Mac. Too many modules (while they do install) simply do not work from Mac OSX, for the reason that @Thomas Weiss  mentioned. Even while many "e-learning books" claim that functionalities work with the PowerShell Core from a Mac (even documented with screenshots): they do not work. I talked to many people, and contacted a famous PnP programmer, they clearly stated that a lot if not most modules will not work from a Mac. 

 

My advise, if you are Mac user with a need/wish to work with Powershell:

- Use Bootcamp on your Mac to set up a lean Window partition; so you will get a truly native Windows installation); switching between OSX and WIN10 required a restart, but that takes a little of your time, like 10 seconds.

- download a Windows 10 installation from Microsoft. You are allowed to use it for a while without activation of the licence; at the end I preferred activating the licence, Windows 10 is worth its money (while I maintain convinced that MacOS is the better OS).

- then install the Windows PowerShell on your Windows  account (running natively on your Mac). Install Windows PowerShell 5.1;  the version where you see so many blogs and docs advising NOT to use it. But the point is, this Powershell version does everything you expect, it has a nice, very user-friendly interface as well. Use any of your OneDrive accounts to store scripts, so you can also look at them from your OSX environment.

- also install Visual Studio Code as well (you can also do this on your Mac, but ... without the Cmdlets not working, you would do that is you want to use other features, like help with your JSON code).

Succes!!!

@Bernd_Kroon I tested again and at least the Combination Powershell 7 and the modern PnP.Powershell Module work successfully with the device login option when logging in. SharePoint Online management shell is still broken.