Install-Module : A parameter cannot be found that matches parameter name ‘AllowPrerelease’

A parameter cannot be found that matches parameter name

To try a prerelease of PowerShell modules, you need to specify the AllowPrerelease parameter, e.g., like this:

Install-Module -Name ExchangeOnlineManagement -AllowPrerelease

This helps PowerShell make sure that you’re genuinely interested in a prerelease and that you understand the risk. 😊

But, in some cases, the -AllowPrerelease will render the following error message:

Install-Module : A parameter cannot be found that matches parameter name 'AllowPrerelease'.
At line:1 char:47
+ install-module -name exchangeonlinemanagement -AllowPrerelease
+                                               ~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Install-Module], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Install-Module

Long story short: Update the PowerShellGet module to the latest version by running the following command:

Update-Module PowerShellGet -Force

Then start a new PowerShell console, and you’re good to go!

WARNING! BONUS INFO AHEAD!

If you want to pick up a more generic approach to solving this type of issue, continue reading.

How to Solve Any PowerShell Parameter Issue

A sound and vibrant PowerShell module continues to receive great feature updates.

If a parameter is not working in whatever version of whatever module you’re running, use the following approach:

  1. Check what module your command belongs to
  2. Update the module to the latest version

Check What Module a PowerShell Command Belongs To

You can easily find out what module your PowerShell command comes from.

In my case, the Install-Module command was causing the problem, so I ran the following:

PS C:\> Get-Command Install-Module

CommandType     Name                Version    Source
-----------     ----                -------    ------
Function        Install-Module      1.0.0.1    PowerShellGet

As you see, the source of the Install-Module command is an ancient version of the PowerShellGet module.

Update the Module to the Latest Version

I will update to the latest version using the following command:

Update-Module PowerShellGet -Force

And after starting a new PowerShell console, everything looks cool:

PS C:\> Get-Command Install-Module

CommandType     Name                Version    Source
-----------     ----                -------    ------
Function        Install-Module      2.2.5      PowerShellGet

– and i’m finally able to update my ExchangeOnlineManagement (or whatever) module to the latest prerelease.

Fed Up With Troubleshooting PowerShell Modules?

If your hybrid Office 365 management is an endless nightmare of googling PowerShell CmdLets, it’s time to wake up to a new dawn!

With Easy365Manager, you no longer need to remember PowerShell commands (or use multiple web consoles) to manage your Office 365 licenses and mailboxes.

Easy365Manager is a snap-in to Active Directory Users & Computers that makes Office 365 administration an integrated part of your AD management.

Check out how you, e.g., can assign Office 365 license (and mailboxes) directly from user properties: 

Create an Office 365 mailbox using Easy365Manager

Easy365Manager supports many configurations that are only available via PowerShell, e.g., configuring calendar permissions or setting mailbox quotas.

Download your 30-day fully-functional trial now. The simple installer will have you up and running in a few minutes.

Did you like this post? Maybe your friends will too!