Git Product home page Git Product logo

pnp-powershell's Introduction

SharePointPnP.PowerShell Commands

Summary

This solution contains a library of PowerShell commands that allows you to perform complex provisioning and artifact management actions towards SharePoint. The commands use CSOM and can work against both SharePoint Online as SharePoint On-Premises.

SharePoint Patterns and Practices

Applies to

  • Office 365 Multi Tenant (MT)
  • Office 365 Dedicated (D)
  • SharePoint 2013 on-premises
  • SharePoint 2016 on-premises

Prerequisites

In order to generate the Cmdlet help you need to have the Windows Management Framework v4.0 installed, which you can download from http://www.microsoft.com/en-us/download/details.aspx?id=40855

Solution

Solution Author(s)
SharePointPnP.PowerShell Erwin van Hunen and countless number of community contributors

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.


Commands included

Navigate here for an overview of all cmdlets and their parameters

Installation

There are 3 ways to install the cmdlets. We recommend, where possible, to install them from the PowerShell Gallery. Alternatively you can download the setup files or run a PowerShell script to download the PowerShellGet module and install the cmdlets subsequently.

PowerShell Gallery

If you main OS is Windows 10, of if you have PowerShellGet installed, you can run the following commands to install the PowerShell cmdlets:

SharePoint Version Command to install
SharePoint Online Install-Module SharePointPnPPowerShellOnline
SharePoint 2016 Install-Module SharePointPnPPowerShell2016
SharePoint 2013 Install-Module SharePointPnPPowerShell2013

Notice: if you install the latest PowerShellGet from Github, you might receive an error message stating

PackageManagement\Install-Package : The version 'x.x.x.x' of the module 'SharePointPnPPowerShellOnline' being installed is not catalog signed.

In order to install the cmdlets when you get this error specify the -SkipPublisherCheck switch with the Install-Module cmdlet, e.g. Install-Module SharePointPnPPowerShellOnline -SkipPublisherCheck -AllowClobber

Setup files

You can download setup files from the releases section of the PnP PowerShell repository. These files will up be updated on a monthly basis. Run the install and restart any open instances of PowerShell to use the cmdlets.

Installation script

This is an alternative for installation on machines that have at least PowerShell v3 installed. You can find the version of PowerShell by opening PowerShell and running $PSVersionTable.PSVersion. The value for Major should be above 3.

To install the cmdlets you can run the below command which will install PowerShell Package Management and then install the PowerShell Modules from the PowerShell Gallery.

Invoke-Expression (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/OfficeDev/PnP-PowerShell/master/Samples/Modules.Install/Install-SharePointPnPPowerShell.ps1')

If you wish to see the commands that the above will run please see the files as stored in the below locations:

Once the above has been completed you can then start to use the PowerShell Modules.

Updating

Every month a new release will be made available of the PnP PowerShell Cmdlets. If you earlier installed the cmdlets using the setup file, simply download the latest version and run the setup. This will update your existing installation.

If you have installed the cmdlets using PowerShellGet with Install-Module from the PowerShell Gallery then you will be able to use the following command to install the latest updated version:

Update-Module SharePointPnPPowerShell*

This will automatically load the module after starting PowerShell 3.0.

You can check the installed PnP-PowerShell versions with the following command:

Get-Module SharePointPnPPowerShell* -ListAvailable | Select-Object Name,Version | Sort-Object Version -Descending

Getting started

To use the library you first need to connect to your tenant:

Connect-PnPOnline –Url https://yoursite.sharepoint.com –Credentials (Get-Credential)

To view all cmdlets, enter:

Get-Command -Module *PnP*

At the following links you will find a few videos on how to get started with the cmdlets:

Setting up credentials

See this wiki page for more information on how to use the Windows Credential Manager to setup credentials that you can use in unattended scripts.

Contributing

If you want to contribute to this SharePoint Patterns and Practices PowerShel library, please proceed here

Building the source code

When you build the solution a postbuild script will copy the required files to a folder in your users folder called C:\Users\<YourUserName>\Documents\WindowsPowerShell\Modules\SharePointPnPPowerShell<Platform>. During build also the help and document files will be generated

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

pnp-powershell's People

Contributors

erwinvanhunen avatar wobba avatar paolopia avatar afsandeberg avatar modery avatar koenzomers avatar laskewitz avatar vesajuvonen avatar mrpullen avatar jansenbe avatar kilasuit avatar sharepointradi avatar casselc avatar camiloborges avatar nickvdheuvel avatar oaden avatar artokai avatar johnnygoodey avatar skaggej avatar nprice99 avatar ibondy avatar lforner avatar spdoctor avatar paulwillen avatar inputoutputcode avatar brannmar avatar stevebeauge avatar rus7am avatar rjesh-git avatar pieter-veenstra avatar

Watchers

James Cloos avatar Marcin Baczewski avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.