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

PowerShell

VIDEO – PowerShell automated WebDeploy ZIP install

This video will demonstrate how to test, build, publish, and install WebDeploy ZIP packages.   The example walks through a simple WebAPI HTTP endpoint which echoes back the current date and time.   Fiddler is leveraged for HTTP testing.   Once tested succesful, we publish the project to ZIP for install on IIS hosted infrastructure.

PowerShell cmdlet Restore-WDPackage is used to extract ZIP content and create a permanent home for the API endpoint.

By automating with PowerShell we provide a fast consistent admin experience to ensure the API is always installed the same way for a reliable repeatable procedure.  Thanks for watching.

Cheers! 

shades_smile

Video

Code

Add-PSSnapin WDeploySnapin3.0
$package = "C:\temp\Hello\deploy\Hello.zip"
Restore-WDPackage $package -Parameters @{"IIS Web Application Name"="API/Hello"}

Screenshot

image

References

PowerShell – Install Module (Verbose Debug)

By setting the system variable $debugPreference = “Continue” we are able to see file level detail when installing PowerShell modules.  This can be helpful to gain an understanding of the dependency and files contained with a module.   Cool trick I didn’t know about until today.

Cheers! 

shades_smile

Code

Screenshots

image

image

image

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

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲