PnP PowerShell and more...

Here I occasionally post about Microsoft 365 Patterns and Practices in general and PnP PowerShell more specifically.

Using PowerShell in Visual Studio Code on MacOS

2018-03-22 2 min read
If you day to day life revolves around MacOS and Visual Studio Code but the rest of your team is working on Windows, you might see that many of them are using PowerShell. You don’t have to be the odd-person-out, and besides that, PowerShell is an amazing shell in general, providing a scripting environment that is very hard to beat by other shells. So, a few things to do: Install PowerShell Navigate to https://github. Continue reading

Automatic Context Switching in PnP PowerShell

2018-03-21 2 min read PowerShell SharePoint
PnP PowerShell does something we call ‘context switching’. Let me show you how this is making your life a tiny bit easier: Connect-PnPOnline https://contoso.sharepoint.com Get-PnPList Get-PnPTenantSite This will connect first to your root site collection in your tenant, return all the lists in the site, and then the next cmdlet will show you all the (classic) site collections in your tenant. Normally you would have to connect (if you’re a developer, you have to create a new ClientContext) to your tenant admin site first in order to do this. Continue reading

Connect-PnPOnline demystified

2018-03-21 2 min read
So here goes: the long list of all ways to authenticate with PnP PowerShell, including some tips ##Credentials This is the most common way and I assume that many of you start off using this method. Connect-PnPOnline -Url https://contoso.sharepoint.com If you have not done any set up in the Windows Credential Manager, then executing the cmdlet like will popup a prompt for a username and password. It’s the easiest way to authenticate Continue reading

Getting started with the PnP Provisioning Engine and PnP PowerShell

2018-03-19 6 min read PowerShell SharePoint
Two of the most popular cmdlets in the PnP PowerShell module are Get-PnPProvisioningTemplate and its sibling Apply-PnPProvisioningTemplate. Follow me in this post where I dive into using them and show how make the most of them in your provisioning flow. Creating a Template Okay, so while it’s totally possible to start creating a template by hand from scratch, it’s a daunting task for sure. The PnP Provisioning Engine supports so many artifacts and each artifact has so many properties, you’ll end up browsing the schema documentation for hours to come. Continue reading

The hidden gem in PnP PowerShell

2018-03-17 1 min read
There is something ‘hidden in plain sight’ in PnP PowerShell for SharePoint Online, and it’s been there already for a few years. Let me show you the command: Connect-PnPOnline -Url https://contoso.sharepoint.com -CreateDrive Notice that last parameter? -CreateDrive. It does exactly what it says it does. It creates a drive that you can navigate into. And you are effectively navigating into your site. How cool is that? By default it creates a drive called SPO: Continue reading

PnP PowerShell and multi-factor authentication

2018-03-16 3 min read PowerShell SharePoint
If you use PnP PowerShell, you might be aware of the fact that there many many ways to authenticate towards your SharePoint Online Tenant. If you have multi-factor authentication enabled on your tenant, basically the only way for you to connect to your tenant was by using the -UseWebLogin method. The way it worked is that we launched a browser window, you authenticated, and we captured the authentication cookie that was returned by the browser. Continue reading

Cross Platform PnP PowerShell

2018-03-14 6 min read PowerShell SharePoint
For a long time I played with the thought: wouldn’t it be nice if we could use PnP PowerShell on other platforms than just Windows? I realize that the majority of you are most likely running Windows, but there is a (albeit minor) part of you that prefer to work on a Mac, and most likely even a smaller part runs on Linux. However, with the growth and functionality of Azure, another possible location to run your cmdlets show up: in a Docker image (which is based upon Linux for instance). Continue reading
Older posts Newer posts