pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
985 stars 665 forks source link

Get-PnPApp does not list apps installed from store #1738

Open kutschinsl opened 5 years ago

kutschinsl commented 5 years ago

Reporting an Issue or Missing Feature

Missing Feature

Expected behavior

Get-PnPApp should return all apps installed on the site including those installed from the store. Get-PnPAppInstance does this but is deprecated.

Actual behavior

Get-PnPApp only returns apps from the tenant or site catalog.

Steps to reproduce behavior

Install an app from the store Get-PnPApp

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

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

SharePointPnPPowerShellOnline 3.2.1810.0

How did you install the PnP-PowerShell Cmdlets?

blair24 commented 5 years ago

Same issue here. When you run Get-PnPAppInstance to get the App ID and try to install the app the following error is returned:

Install-PnPApp : {"error":{"code":"-1, Microsoft.SharePoint.Client.ResourceNotFoundException","message":{"lang":"en-US","value":"Exception of type 'Microsoft.SharePoint.Client.ResourceNotFoundException' was thrown."}}} At line:1 char:1

kutschinsl commented 5 years ago

Any update on this?

pcardosolei commented 5 years ago

@blair24 change your $ErrorActionPreference to "Stop" on a try catch.

did you try use the Get-PnPListitem ? @kutschinsl

kutschinsl commented 5 years ago

I'm not sure how Get-PnPListItem would be relevant?

pcardosolei commented 5 years ago

It is possible to get the same information or maybe more using the list item for tenant and site collection locations.

EDIT:

with the Get-PnPListItem there is more information available in the script

kutschinsl commented 5 years ago

The issue is that Get-PnPApp does not retrieve information from apps installed from the Microsoft store. Get-PnPAppInstance does do this but it is marked as deprecated. Could you explain how to use Get-PnPListItem to retrieve information about an App that has been installed from the Microsoft store?

pcardosolei commented 5 years ago

Do you have idea where the app is located?

On Tue, 11 Jun 2019, 20:31 Luke Kutschinski, notifications@github.com wrote:

The issue is that Get-PnPApp does not retrieve information from apps installed from the Microsoft store. Get-PnPAppInstance does do this but it is marked as deprecated. Could you explain how to use Get-PnPListItem to retrieve information about an App that has been installed from the Microsoft store?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SharePoint/PnP-PowerShell/issues/1738?email_source=notifications&email_token=ACNFYLQWZUJ4ON7XU4CSVWDPZ74RFA5CNFSM4F23EU22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXOH5OQ#issuecomment-500989626, or mute the thread https://github.com/notifications/unsubscribe-auth/ACNFYLXIGAHIJOCZSMTVCTDPZ74RFANCNFSM4F23EU2Q .

kutschinsl commented 5 years ago

I wish I knew - however apps from the store behave differently than those installed locally on the tenant or site catalog.

To me it doesn't make sense why Get-PnPAppInstance would be deprecated in favor of Get-PnPApp because they are returning different information. For example the App ID and the App Instance ID are different. In addition Get-PnPAppInstance give you information about the state of the app on the current site which is useful for provisioning scripts. Get-PnPApp only returns metadata about the app in the catalog which as you mentioned can be returned also with Get-PnPListItem.

JaredRic-MSFT commented 5 years ago

To add to the above, see the output when running the two commands against the same web:

PS C:> Get-PnPAppInstance | Format-List Title, Id WARNING: The command 'Get-PnPAppInstance' is obsolete. Use Get-PnPApp instead

Title : Nintex Workflow for Office 365 Id : d251dae2-6b5a-4a18-bfce-a1884eded954

PS C:> Get-PnPApp | Format-List Title, Id

Title : SharePointAppPart Id : cb4c7fcf-751c-49cf-88a1-4b94a7c45599

Title : sampleAppPart Id : 7f54213e-db0e-4518-ab8d-7c29b0897511

garima2510 commented 4 years ago

Following this, is there any way to install a provider hosted add-in from app store using ALM API?