3

You could use a CAML query to select your files. This example will get the last 5 modified files. Note that RowLimit won't work as expected, hence the select -first 5 at the end $listname = "Documents" $query = "<View><Query><OrderBy><FieldRef Ascending='False' Name='Modified'/></OrderBy></Query></View>" $items = ...


2

As far as I know, there is not yet a specific PnP cmdlet to help with this. The trick is that SharePoint doesn't care that the contents of your file are JSON or plain Text, it still stores it as a binary file. So you have to retrieve it as a binary stream, then read that stream into a string variable. Then finally, if you want an actual PowerShell object ...


2

You can refer the below PowerShell script : $listArray = New-Object System.Collections.Generic.List[System.Object] foreach ($item in $ListItems) { $listArray.Add([hashtable]@{ DisplayTitle=$item["Title"]; Setting= $item["Setting"]; Description= $item["File_x0020_Description"]; HealthAreas= $item["Health_x0020_Area"]; ResourceType= $item["...


2

You can use this cmdlet : Get-PnPFile Get-PnPFile -Url fileUrl -AsFile


2

We can download the file from SharePoint online using the below PowerShell code - this code will download load all files from the given SharePoint online library within the given date ranges, however if you want to do the specific file inside the for each loop you need to add an if condition for the file you want to download. #Load SharePoint CSOM ...


2

There is no ready-made PowerShell script for your requirement. But, I will help you to build this script on your own. Get DefaultLinkType property of a SharePoint site: If you want to get the DefaultLinkType property of a SharePoint site then you can use: $site = Get-SPOSite -Identity https://spexplorer.sharepoint.com/sites/SPConnect -Detailed $site....


2

Customisation of pages is not yet supported in site designs. One option would be to apply a provisioning template once the site is created. About the PnP provisioning engine More reading: Calling the PnP provisioning engine from a site script


2

Thanks @RuneSperre for your solution. It worked. Below is the working script Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue $users= "" $users = import-csv D:\User.csv foreach ($user in $users) { Add-SPOUser -Site $user.SiteURL -LoginName $user.UserEmailAddress -Group "$($user.group)" Write-host "User added:" $user.SiteURL $...


1

One of two options: In code, check for the Web Application (ID, URL, etc.) and use if/else/switch statements to go between code paths. This allows you to use a single solution for all Web Applications. Create a new solution and port your code. Each solution has a GUID that is unique on a per-farm basis.


1

You cannot do it by using the SharePoint Online PowerShell directly, that is mainly for maintenance tasks. Luckily we have the PnP PowerShell Library that makes these kinds of operations quite easy: Connect-PnPOnline -Url "https://domain.sharepoint.com/sites/sitename" -Credentials (Get-Credential) $listname = "TestUpdate" $items = Get-PnPListItem -List $...


1

A caml query will be enough to make the script delete files in a specific folder according to date. $site = new-object Microsoft.SharePoint.SPSite("site url") $web = $site.rootweb $list = $web.Lists["library name"] $query=new-object Microsoft.SharePoint.SPQuery $caml='<Where> <Leq> <FieldRef Name="Created" /> ...


1

You could use the out of the box feature "Variations" to achieve this. This feature makes content available to specific audiences on different sites by syncing content from a source variation site to each target variation site. You could refer to this article: https://docs.microsoft.com/en-us/archive/blogs/sharepoint_quick_reads/sharepoint-2013-variations-...


1

Here is a complete PowerShell script to automate the SharePoint update installation in all servers but post-execution of this script at least an hour you need to spend time verifying the update. <# Updated for SharePoint Server 2016 and 2019 by Trevor Seward (https://thesharepointfarm.com). Original script provided by Russ Maxwell, available for ...


1

You can use the below powershell script that will allow you to quickly identify on what site an app is installed, and what version of it is installed $appTitle = Read-Host "What is your App's title?" $rootUrl = Read-Host "What is your Web Application's Root Url?" $webApp = Get-SPWebApplication $rootUrl foreach($site in $webApp.Sites) { foreach($web ...


Only top voted, non community-wiki answers of a minimum length are eligible