Connect-PnPOnline : The term ‘Connect-PnPOnline’ is not recognized

Are you getting the error “connect-pnponline not recognized” while working with PnP PowerShell? I recently received this error. Let me explain to you how to fix the error.

The complete error comes as: Connect-PnPOnline: The term ‘Connect-PnPOnline’ is not recognized as the name of a cmdlet, function, script file, or operable program.

In particular, I received this error while I was trying to connect to SharePoint Online using the Connect-PnPOnline PnP PowerShell cmdlets.

The command I was running is the following:

Connect-PnPOnline -Url 'https://tsinfo.sharepoint.com/sites/SPFxTraining/' -Credentials (Get-Credential)

The full error comes as:

Connect-PnPOnline : The term ‘Connect-PnPOnline’ 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.
At line:1 char:1

  • Connect-PnPOnline -Url ‘https://tsinfo.sharepoint.com/sites/SPFxTrain …
  • ~~~~~
    • CategoryInfo : ObjectNotFound: (Connect-PnPOnline:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

You can see the exact error message in the screenshot below:

connect-pnponline the term 'connect-pnponline' is not recognized as the name of a cmdlet

Connect-PnPOnline : The term ‘Connect-PnPOnline’ is not recognized

To fix the error, either Open a PowerShell command prompt or PowerShell ISE and run the below command.

Install-Module SharePointPnPPowerShellOnline

Once you run the command, It will ask for a confirmation message.

You are installing the modules from an untrusted repository……..

Click on Yes to All like below:

connect-pnponline is not recognized

Then you can see it will install the SharePointPnPPowerShellOnline package like below:

connect-pnponline the term connect-pnponline is not recognized as the name

Now, when you run the Connect-PnPOnline, Get-PnPList or Get-PnPField cmdlets, you will not get any error.

If you’re using a newer version of PowerShell, you might need to install the updated module instead:

Install-Module PnP.PowerShell

The PnP PowerShell module is essential for managing SharePoint sites, lists, and permissions through scripts. It allows you to authenticate to SharePoint using various methods, including:

  • Username and password
  • App-only authentication
  • Modern authentication with MFA support
  • Certificate-based authentication

This module is maintained by the Microsoft 365 Patterns and Practices team and is regularly updated to support the latest SharePoint features and authentication methods.

In this tutorial, I have explained how to fix the error: Connect-PnPOnline : The term ‘Connect-PnPOnline’ is not recognized.

You may also like the following tutorials:

  • 21st of November 2022

    WARNING:
    You are running the legacy version of PnP PowerShell.

    This version will be archived soon which means that while staying available, no updates or fixes will be released.
    Consider installing the newer prereleased cross-platform version of PnP PowerShell.
    This version has numerous improvements and many more cmdlets available.
    To install the new version:

    Uninstall-Module -Name SharePointPnPPowerShellOnline -AllVersions -Force
    Install-Module -Name PnP.PowerShell

  • >
    SPGUIDES.ACADEMY
    LEARN. BUILD. TRANSFORM.
    â–¶ Live FREE Webinar

    Build an AI-Powered
    Invoice Processing
    App

    Learn how to build an intelligent invoice processing solution using:

    S SharePoint
    â—† Power Apps
    ➤ Power Automate
    ✦ Copilot Studio
    PDF INVOICE
    →
    AI
    →
    ◆ ➤ S
    From Invoice
    to Insights
    Invoice Processing ↑ Upload Invoice
    INVOICE
    TOTAL $1,950.00
    Extracted Information
    Vendor Name Contoso Ltd.
    Invoice Number INV-1001
    Invoice Date 09/05/2026
    Due Date 09/25/2026
    Line Items
    Laptop 2 $1,600.00
    Mouse 5 $150.00
    ✓ Save to SharePoint
    â–£
    DATE 22nd September 2026
    â—·
    TIME 10:00 AM EST 7:30 PM IST
    ⌛
    DURATION 60 Minutes
    🚀 Save Your Free Seat ›

    Live Webinar

    SharePoint Integration Power Apps Form With Repeating Table [Invoice Management System]

    Learn how to build a real-world Invoice Management System using a SharePoint Integration Power Apps Form with a repeating table—supporting multiple invoice line items.

    📅 2nd September 2026 – 10:00 AM EST | 7:30 PM IST

    Build a High-Performance Project Management Site in SharePoint Online

    User registration Power Apps canvas app

    DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

    Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

    Power Platform Tutorial FREE PDF Download

    FREE Power Platform Tutorial PDF

    Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…