Skip to content

[BUG - Update-Module -Name "PnP.Powershell" returning an error - PnP.Powershell was not installed by using Install-Module so it cannot be updated #1757

@hsamdani12

Description

@hsamdani12

I'm currently on version 1.8.0 for PnP.Powershell.

When I run the following command -
Get-Module PnP -ListAvailable | Select-Object Name,Version | Sort-Object Version -Descending

This is what I get -
Name Version


PnP.PowerShell 1.8.0
PnpDevice 1.0.0.0

I'm trying to update to latest version using the following command -
Update-Module -Name "PnP.Powershell" -RequiredVersion 1.10.0 -Force

Expected behavior

I'm sure I used Install-Module to install the PnP. Powershell v 1.8.0. I should be able to update it to latest version of PnP.Powershell

Actual behavior

I get the following error when doing an upgrade -
Update-Module : Module 'PnP.Powershell' was not installed by using Install-Module, so it cannot be updated.
At line:1 char:1

  • Update-Module -Name "PnP.Powershell" -RequiredVersion 1.10.0 -Force
  •   + CategoryInfo          : InvalidOperation: (PnP.Powershell:String) [Write-Error], WriteErrorException
      + FullyQualifiedErrorId : ModuleNotInstalledUsingInstallModuleCmdlet,Update-Module
    
    
    

Steps to reproduce behavior

Please include complete script or code samples in-line or linked from gists

What is the version of the Cmdlet module you are running?

PnP.PowerShell 1.8.0

Which operating system/environment are you running PnP PowerShell on?

  • [x ] Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions