Introduction: –
In this article, I will explain how to use SharePoint Online Management Shell, SharePoint PnP PowerShell and Office 365 CLI, using an example – Enable site collection level App Catalog.
So, let’s get started!
Using SharePoint Online Management Shell: –
- Download SharePoint Online Management Shell
- Open management Shell as Administrator and run the below two commands: –
Connect-SPOService -Url https://vipsitworld2-admin.sharepoint.com
Add-SPOSiteCollectionAppCatalog -Site “https://vipsitworld2.sharepoint.com/sites/TestSite“
Using SharePoint PnP PowerShell: –
- Open Windows PowerShell (Windows 10 machine) and run the below command –
Find-Module SharePointPnPPowerShell* - Install SharePoint PnP PowerShell using the command –
Install-Module SharePointPnPPowerShellOnline - To check the installd module in your system, run the command –
Get-Module SharePointPnPPowerShell* -ListAvailable - Connect to SharePoint Online using the below command –
Connect-PnPOnline -Url https://vipsitworld2-admin.sharepoint.com - Run the below command to create site collection level App Catalog –
Add-PnPSiteCollectionAppCatalog -site https://vipsitworld2.sharepoint.com/sites/TestSite2
Using Office 365 CLI: –
- The Office 365 CLI is distributed as an NPM package. So, first install Node JS.
- Install Office 365 CLI using the command –
npm i -g @pnp/office365-cli - Start the Office 365 CLI by typing in the command line: office365
- Running the office365 command will start the immersive CLI with its own command prompt.
- Start managing the settings of your Office 365 tenant by logging in to it, using the login command : o365$ login
- To list all available commands, type in the Office 365 CLI prompt help: o365$ help
- To exit the CLI, type:o365$ exit or quit
- Connect to SharePoint Online using the command –
spo login https://vipsitworld2-admin.sharepoint.com - Run the below command to create site collection level App Catalog –
spo site appcatalog add –url https://vipsitworld2.sharepoint.com/sites/TestSite3