pnp powershell
18 TopicsFacing issue in installing the Pnp PowerShell Module for SharePoint 2013/Online
Hi All, I am facing issue in installing the PnP PowerShell module for SharePoint 2013/online. Please let me know if anyone has faced such issue Chendrayan Venkatesan . Error Description: PS C:\WINDOWS\system32> Install-Module SharePointPnPPowerShell2013 PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'SharePointPnPPowerShell2013'. Try Get-PSRepository to see all available registered module repositories. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21 + ... $null = PackageManagement\Install-Package @PSBoundParameters + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage PS C:\WINDOWS\system32> Install-Module SharePointPnPPowerShellOnline PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'SharePointPnPPowerShellOnline'. Try Get-PSRepository to see all available registered module repositories. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21 + ... $null = PackageManagement\Install-Package @PSBoundParameters + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage PS C:\WINDOWS\system32> $PSVersionTable.PSVersion Major Minor Build Revision ----- ----- ----- -------- 5 1 17134 407 Thanks, Prabhu36KViews0likes5CommentsRandom issues with Pnp Powershell in Azure Runbooks
Hi everyone, we're facing random issues when running PnP powershell from Azure runbooks when several instances of the same runbook run concurrently. The scenario We have several of runbooks, they all use PnP Powershell, and each of them perform different actions, such as Enabling site collection app catalog, scripting, external sharing, creating a list etc. Those runbooks get triggered in two different ways: - one is triggered after a new site is created, through a site script, that triggers a logic app and from there we trigger the runbook - the others are triggered via webhook (http post from a function attached to a queue) The issues When the same runbook is triggered more than once at the same time, they fail in different ways: - we see the logs being logged more than once, then the runbooks get suspended - pnp randomly fails, it does not enable the site catalog, or enable scripting, etc - if we put our code inside a try catch block, we use to read weird errors (null reference, invalid connection when using Connect-PnPOnline, etc) Some errors are: Set-PnPTenantSite : Object reference not set to an instance of an object. At line:41 char:9 Connect-PnPOnline : Token request failed. At line:31 char:5 Set-PnPTenantSite : No connection, please connect first with Connect-PnPOnline At line:41 char:9 Add-PnPSiteCollectionAppCatalog : Object reference not set to an instance of an object. Background info: The runbooks were never executed at the same time against the same site. When we trigger them concurrently, we only do it for 10 sites, and the runbooks are pretty simple (connect to the tenant, enable site collection app catalog, and then disconnect) Any ideas? Thanks5.8KViews0likes1CommentAzure Automation Runbooks using Powershell: Push notifications error?
I'm trying to run some PnP PowerShell commands in an Azure Runbook (e.g. Get-PnPContentType, Apply-PnPProvisioningTemplate, etc. ) over a SharePoint site, but it keeps returning the error below: The Push Notifications feature is not activated on the site The correct modules have been imported and it only errors on some commands. Running the commands in a PowerShell window with the same credentials doesn't produce any errors, and activating the 'Push Notifications' feature manually and retriggering the Runbook won't produce any error output, but will say that the Runbook failed to run 3 times.4.1KViews0likes1CommentProgramatically change the new menu in modern libraries
I am creating a lot of document libraries with code in our enterprise and each library should have different content types. Unfortunately after updating the content types with CSOM, the default Word, Excel and PowerPoint templates disappear from the New-Menu in a modern library. Instead the content types are shown. Because I am not able to change the edit menu in hundreds of libraries back to the default, I would like to archive this within my software. I already found how to do thishttps://cann0nf0dder.wordpress.com/2019/03/24/programmatically-change-the-new-menu-in-sharepoint-online-using-powershell/l here, but would like to do it from withint C# (REST or CSOM) Any ideas how I could archive that?2.7KViews0likes1CommentCopy-PnPFile Not Working Value cannot be null.\r\nParameter name: Null value for source item at
I'm tying to use Copy-PnPFile command to copy all files and folders from site collection A document library to another site collection B/folder but it's not working. Following is the command I'm using: Copy-PnPFile -SourceUrl "/sites/AshTest/Docs" -TargetUrl "/sites/ADM-AshTest/TestDocs/Docs" -Force Error, please let me know what can be done to make it work. Copy-PnPFile : {"odata.error":{"code":"-2147467261, System.ArgumentNullException","message":{"lang":"en-US","value":"Value cannot be null.\r\nParameter name: Null value for source item at https://tenant.sharepoint.com/sites/AshTest/Docs"}}} At line:1 char:1 + Copy-PnPFile -SourceUrl "/sites/AshTest/Docs" -TargetUrl "/sites/ADM- ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : WriteError: (:) [Copy-PnPFile], HttpRequestException + FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Files.CopyFile2.6KViews0likes3CommentsGet column position of webpart modern SharePoint page
Who could help me? For some good reason I have to get the column and section of an existing webpart that I want to use later in my Powershell script. Now I can easily get the section and use it again. But I cannot get the column as a variable. I already tried it as you see below with a substring or a split. But I noticed that different results came back at different sites. So again, who knows the solution for me?Solved2.4KViews0likes4CommentsAdd-PnPClientSideWebPart : One or more errors occurred.
Why is this happening? Does not matter what kind of web part, this one a document library, I still get the same kind of error message. Using the latest version of PnP for SharePoint Online. I can create a page with PnP, add a Text part and so on... https://github.com/pnp/PnP-PowerShell/issues/2913 Add-PnPClientSideWebPart -Page $Page -DefaultWebPartType List -Section 1 -Column 1 -WebPartProperties @{isDocumentLibrary="true";selectedListId="a4140c74-b780-417c-89c1-381e24a6e699"} Add-PnPClientSideWebPart : One or more errors occurred. At line:1 char:1 + Add-PnPClientSideWebPart -Page $Page -DefaultWebPartType List -Sectio ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : WriteError: (:) [Add-PnPClientSideWebPart], AggregateException + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.WebParts.AddClientSideWebPart2.1KViews0likes1CommentHow to retrieve nodes in another language with Get-PnPNavigationNode in PnP PowerShell?
Get-PnPNavigationNode returns the node titles in the default language of the site (I guess). Is there a way to retrieve the nodes translated in another language? I could not find a way to change the language on the connection or context. Can we somehow add the "accept-language" header to the request sent to the REST services? I assume this would help to retrieve the values for the corresponding language.2KViews0likes4CommentsNeed to remove one drive folder using PnP Powershell
Hi Team, I'm trying to remove a folder using PnP and its throwing error as 404 Not Found, commands i am using as below Connect-PnPOnline -Url "onedrive Url" - credential (Get-Credential) $name = "Nest1" $Folderpath = "Document\Nest1" Remove-PnPFolder -Name $name -Folder $Folderpath - Force -Recycle Thank you for your help Regards Saurav2KViews0likes2CommentsSorry we couldn't remove the app - SharePoint Online
Some time you try to remove some installed apps from SharePoint and it removes approx. all the time but some apps says "sorry we couldn't remove the app". To remove these kind of apps, You have to use PowerShell Scripts. So there are some steps : 1. Install PnP PowerShell (https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-pnp/sharepoint-pnp-cmdlets?view=sharepoint-ps) 2. Now run the following PnP command with URL and App Name changes : Connect-PnPOnline –Url <Your_Site_Collection_URL> –Credentials (Get-Credential) $instances = Get-PnPApp $instance = $instances | where {$_.Title -eq '<My_App_Name'} #Uninstall-PnPApp -Identity $instance.Id Remove-PnPApp -Identity $instance.Id1.8KViews0likes0Comments