This script shows how get all the PowerShell cmdlets available to work with SharePoint Online in Office 365. The script defines a function that uses the Get-Command cmdlet as a way to list all the available SharePoint Online cmdlets. In order to get only SharePoint Online cmdlets, a where clause is added to the Get-Command cmdlet. The script also counts the number of SharePoint Online PowerShell cmdlets.

PowerShell
Editar script|Remove
############################################################################################################################################ 
# Script that gets all the available SharePoint Online PowerShell cmdlets 
# Required Parameters: 
#  -> $sUserName: User Name to connect to the SharePoint Admin Center. 
#  -> $sMessage: Message to show in the user credentials prompt. 
#  -> $sSPOAdminCenterUrl: SharePoint Admin Center Url 
############################################################################################################################################ 
$host.Runspace.ThreadOptions = "ReuseThread" 
 
#Definition of the function that gets all the SharePoint Online PowerShell cmdlets 
function Get-SPOPowerShellCmdlets 
{ 
    param ($sUserName,$sMessage) 
    try 
    {     
        Write-Host "----------------------------------------------------------------------------"  -foregroundcolor Green 
        Write-Host "Getting all the SharePoint Online PowerShell cmdlets" -foregroundcolor Green 
        Write-Host "----------------------------------------------------------------------------"  -foregroundcolor Green 
        $msolcred = get-credential -UserName $sUserName -Message $sMessage 
        Connect-SPOService -Url $sSPOAdminCenterUrl -Credential $msolcred 
        $spoCmdlets=Get-Command | where {$_.ModuleName -eq "Microsoft.Online.SharePoint.PowerShell"} 
        Write-Host "There are " $spoCmdlets.Count " Cmdlets in SharePoint Online" 
        $spoCmdlets 
      
    } 
    catch [System.Exception] 
    { 
        write-host -f red $_.Exception.ToString()    
    }     
} 
 
#Connection to Office 365 
$sUserName="<YourOffice365UserLogin>@<YourOffice365Domain>.onmicrosoft.com" 
$sMessage="Introduce your SPO Credentials" 
$sSPOAdminCenterUrl="https://<YourOffice365Domain>-admin.sharepoint.com/" 
 
Get-SPOPowerShellCmdlets -sUserName $sUserName -sMessage $sMessage