Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.
Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.

PowerShell

Reduce SPPKG WebParts Features with Powershell

The below steps will reduce a SPPKG to only select Features and WebParts we want to keep.  Every SPPKG file is actually a ZIP with XML manifest and subfolder for each WebPart and Feature.  Extracting the SPPKG as ZIP allows us to review the internal content, enumerate all Features, and then select ones to keep in a final compressed ZIP file (SPPKG file).

If you want to upload only a few WebParts from a SPPKG package to Office 365’s App Catalog then check out the video below.

Cheers!  

shades_smile

Video

Code

Screenshots

image
image
image

References

VIDEO – Populate Word DOCX with PowerShell

Recently I found a way to dynamically update Microsoft Word text placeholders with PowerShell script.  Because DOCX files are ZIP archive we can extract to a TEMP folder to update the internal XML document text.   From there, bundling to a new ZIP archive and renaming DOCX enable us to deliver the final DOCX version to users.

Below is a demo with full source code.  Cheers! 

shades_smile_thumb

Video

Screenshot

image_thumb[4]

Source Code

PowerShell – Split CSV in 1000 line batches

I recently needed to parse a large CSV text file and break it into smaller batches.  Parsing text with PowerShell can easily be done.  The trick here was to manage two pointers $line (within original large text file) and $i (iterate current up to next break threshold).  The first CSV line with column headers from the original parent text file is preserved in all child CSV files. 

Cheers! 

shades_smile

Source Code

MySite – Export user Quick Links to CSV

When migrating from MySite on-premise to OneDrive in the cloud, Quick Links are not included by third party utilities (i.e. ShareGate).  However, with PowerShell we can export the original raw CSV data and provide a list of links to end users.  They can bookmark or add to Office 365.

Cheers! 

shades_smile

 

Code

 

Screenshot

image

 

image

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲