Office 365 – SharePoint Online – Resolving warning “The names of some imported commands from the module ‘Microsoft.Online.SharePoint.PowerShell’ include unapproved verbs that might make them less discoverable.” while importing module – Microsoft.Online.SharePoint.PowerShell

December 17, 2018December 17, 2018

Hi All,

Today new and very interesting finding. You will definitely like this finding.

Int his article I’ll explain in detail the meaning of warning – “The names of some imported commands from the module ‘Microsoft.Online.SharePoint.PowerShell’include unapproved verbs that might make them less discoverable.” when import the module – Microsoft.Online.SharePoint.PowerShell

Since last couple of months I was always getting one warning while importing the module “Microsoft.Online.SharePoint.PowerShell”. In every PowerShell script we import this module.

WARNING: The names of some imported commands from the module ‘Microsoft.Online.SharePoint.PowerShell’ include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.

Though its only warning, it doesn’t affect in successfully executing our PowerShell script. But this warning is still annoying to me. So, thought to dig into it. In one of the article I found that if we use switch “-DisableNameChecking” then warning goes away as

But then this is again workaround, I want to know the actual reason so more dig into it 🙂

If we observe, PowerShell cmdlet has specific syntax like

<verb> – <noun>

For example – Get-SiteColumn – used to get the site column.

Here Verb – “Get” which identify the action cmdlet performs.

Noun – “SiteColumn” identifies the entity on which the action performed.

PowerShell has provided the predefined verbs and best practice is using those verbs for cmdlets. We can get the all approved verbs or verbs which are provided by PowerShell are using “Get-Verb” PowerShell cmdlet. Following are the approved verbs by PowerShell.

Now coming back to our warning, it says “To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter” So, we will run the Import-Module command again with Verbose parameter as

“VERBOSE: The ‘Upgrade-SPOSite’ command
in the Microsoft.Online.SharePoint.PowerShell’ module was imported, but because
its name does not include an approved verb, it might be difficult to find. For
a list of approved verbs, type Get-Verb. VERBOSE: Importing cmdlet
‘Upgrade-SPOSite’.”

Here notice that “Microsoft.Online.SharePoint.PowerShell” module contains the cmdlet “Upgrade-SPOSite” but “Upgrade” verb is not available in approved verbs as shown in figure 3 and that why this warning.