pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets

Home Page:https://pnp.github.io/powershell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] SharePoint Add-In - Install Error

proce opened this issue · comments

commented

Reporting an Issue or Missing Feature

Issue

Expected behavior

SharePoint Add-In to be installed successfully.

Actual behavior

SharePoint Add-In reports error: "Details: Object reference not set to an instance of an object."
(The same Add-in and scripts succeed on other tenants.)

Picture1

Steps to reproduce behavior

We have tried two methods:

  • PnP PowerShell

  • OfficeDevPnP.Core.ALM.AppManager

Both are failing on this tenant. The same Add-in and scripts succeed on other tenants. We have raised a support call with Microsoft however they have not provided feedback.

PnP PowerShell
We are using the following command:

Install-PnpApp -Identity $appId -scope site

We are then using the following commands to monitor the “InstalledVersion” property. This is never populated.

$app = Get-PnPApp -Scope Site | Where Title -EQ $appId
$app.InstalledVersion

When we check the Install Errors in SharePoint, we see the following error with a correlation ID.
Details: Object reference not set to an instance of an object.

OfficeDevPnP.Core.ALM.AppManager
We are using the “OfficeDevPnP.Core.ALM.AppManager” object and the “Install” method to do this using PowerShell:

$AppInstance = $appManager.GetAvailable($AddInTitle, $site)
$appManager.Install($AppInstance, $site)

We then check the “Status” property in a loop every few seconds to monitor the install:

$AppInstance = $appManager.GetAvailable($AddInTitle, $site) 
$AppInstance.Status

After 30 to 40 seconds, the “Status” property of the add-in instance changes from “Installing” to “Canceling”.
When we check the Install Errors in SharePoint, we see the following error with a correlation ID.
Details: Object reference not set to an instance of an object.
(This is the same error as when using PnP PowerShell.)

Which version of the PnP-PowerShell Cmdlets are you using?

  • PnP PowerShell for SharePoint 2013
  • PnP PowerShell for SharePoint 2016
  • PnP PowerShell for SharePoint 2019
  • PnP PowerShell for SharePoint Online

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

  • 3.23.2007

How did you install the PnP-PowerShell Cmdlets?

  • MSI Installed downloaded from GitHub
  • Installed through the PowerShell Gallery with Install-Module
  • Other means