-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1919 from KoenZomers/ConnectionReferenceFix
Various fixes when using specific Connections
- Loading branch information
Showing
15 changed files
with
140 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,14 @@ | ||
using System.Management.Automation; | ||
|
||
using System; | ||
using PnP.PowerShell.Commands.Properties; | ||
|
||
namespace PnP.PowerShell.Commands.Base | ||
{ | ||
[Cmdlet(VerbsCommon.Get, "PnPConnection")] | ||
[OutputType(typeof(PnPConnection))] | ||
public class GetPnPConnection : PSCmdlet | ||
public class GetPnPConnection : PnPSharePointCmdlet | ||
{ | ||
|
||
protected override void BeginProcessing() | ||
{ | ||
base.BeginProcessing(); | ||
|
||
if (PnPConnection.Current == null) | ||
{ | ||
throw new InvalidOperationException(Resources.NoSharePointConnection); | ||
} | ||
if (PnPConnection.Current.Context == null) | ||
{ | ||
throw new InvalidOperationException(Resources.NoSharePointConnection); | ||
} | ||
} | ||
|
||
protected override void ProcessRecord() | ||
{ | ||
WriteObject(PnPConnection.Current); | ||
WriteObject(Connection); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,14 @@ | ||
using System.Management.Automation; | ||
|
||
using System; | ||
using PnP.PowerShell.Commands.Properties; | ||
|
||
namespace PnP.PowerShell.Commands.Base | ||
{ | ||
[Cmdlet(VerbsCommon.Get, "PnPContext")] | ||
[OutputType(typeof(Microsoft.SharePoint.Client.ClientContext))] | ||
public class GetSPOContext : PSCmdlet | ||
public class GetSPOContext : PnPSharePointCmdlet | ||
{ | ||
|
||
protected override void BeginProcessing() | ||
{ | ||
base.BeginProcessing(); | ||
|
||
if (PnPConnection.Current == null) | ||
{ | ||
throw new InvalidOperationException(Resources.NoSharePointConnection); | ||
} | ||
if (PnPConnection.Current.Context == null) | ||
{ | ||
throw new InvalidOperationException(Resources.NoSharePointConnection); | ||
} | ||
} | ||
|
||
protected override void ProcessRecord() | ||
{ | ||
WriteObject(PnPConnection.Current.Context); | ||
WriteObject(Connection.Context); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.