Skip to main content

Posts

Showing posts with the label Pnp

PowerShell Automation for Smart SharePoint List Migration

PowerShell Automation for Smart SharePoint List Migration Migrating data between SharePoint environments is one of those tasks that looks simple on paper—but in practice, it’s easy to get tangled in duplicates, mismatched fields, or incomplete moves. With many organizations moving from on-premises SharePoint Server to SharePoint Online , automation becomes key to a smooth transition. This guide walks through a PowerShell script that not only moves list items from an on-premises SharePoint list to the cloud but also checks for duplicates before copying. Let’s break it down. Why Automate the Migration? Traditional migrations often copy everything from the source list to the destination list—whether or not those items already exist in the target. The result? Duplicates, clutter, and a messy data clean-up later. This script was designed to solve that. It brings intelligence into the migration process by checking for duplicates first, then deciding whether to move or...

SPFx File Upload using Pnp

Today I came across a requirement to upload file to SharePoint Document library. This task was to be done using SPFx. Pnp helped me with this. Here is the code i used. Below is the code for uploading file and meta data. private   UploadFile ():  void  {          let   input  = < HTMLInputElement >  document . getElementById ( "fileUpload" );          let   files  =  input . files ;          for  ( let   index  =  0 ;  index  <  files . length ;  index ++) {              const   file  =  files [ index ];              if  ( file . size <=  10485760 )    {      //upload...