Table of contents
TOC
Collapse the table of content
Expand the table of content

Set-PnPContext

Bert Jansen|Last Updated: 2/20/2017
|
1 Contributor

Sets the Client Context to use by the cmdlets

Syntax

Set-PnPContext -Context <ClientContext>

Parameters

ParameterTypeRequiredDescription
ContextClientContextTrueThe ClientContext to set

Examples

Example 1

PS:> Connect-PnPOnline -Url $siteAurl -Credentials $credentials
PS:> $ctx = Get-PnPContext
PS:> Get-PnPList # returns the lists from site specified with $siteAurl
PS:> Connect-PnPOnline -Url $siteBurl -Credentials $credentials
PS:> Get-PnPList # returns the lists from the site specified with $siteBurl
PS:> Set-PnPContext -Context $ctx # switch back to site A
PS:> Get-PnPList # returns the lists from site A
© 2017 Microsoft