This repository has been archived by the owner on Jan 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 660
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 #1149 from SharePoint/dev
October 2017 Intermediate Release 1
- Loading branch information
Showing
333 changed files
with
18,934 additions
and
3,742 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#if !ONPREMISES | ||
using OfficeDevPnP.Core.ALM; | ||
using SharePointPnP.PowerShell.CmdletHelpAttributes; | ||
using System.Management.Automation; | ||
|
||
namespace SharePointPnP.PowerShell.Commands.Apps | ||
{ | ||
[Cmdlet(VerbsCommon.Add, "PnPApp")] | ||
[CmdletHelp("Add/uploads an available app to the app catalog", | ||
Category = CmdletHelpCategory.Apps, SupportedPlatform = CmdletSupportedPlatform.Online, | ||
OutputType = typeof(AppMetadata))] | ||
[CmdletExample(Code = @"PS:> Add-PnPApp -Path ./myapp.sppkg", Remarks = @"This will upload the specified app package to the app catalog", SortOrder = 1)] | ||
public class AddApp : PnPCmdlet | ||
{ | ||
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, HelpMessage = "Specifies the Id or an actual app metadata instance")] | ||
public string Path; | ||
|
||
protected override void ExecuteCmdlet() | ||
{ | ||
if (!System.IO.Path.IsPathRooted(Path)) | ||
{ | ||
Path = System.IO.Path.Combine(SessionState.Path.CurrentFileSystemLocation.Path, Path); | ||
} | ||
|
||
var fileInfo = new System.IO.FileInfo(Path); | ||
|
||
var bytes = System.IO.File.ReadAllBytes(Path); | ||
|
||
var manager = new AppManager(ClientContext); | ||
|
||
var result = manager.Add(bytes, fileInfo.Name); | ||
|
||
WriteObject(result); | ||
} | ||
} | ||
} | ||
#endif |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#if !ONPREMISES | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Management.Automation; | ||
using SharePointPnP.PowerShell.CmdletHelpAttributes; | ||
using SharePointPnP.PowerShell.Commands.Base.PipeBinds; | ||
using OfficeDevPnP.Core.ALM; | ||
|
||
namespace SharePointPnP.PowerShell.Commands.Apps | ||
{ | ||
[Cmdlet(VerbsCommon.Get, "PnPApp")] | ||
[CmdletHelp("Returns the available apps from the app catalog", | ||
Category = CmdletHelpCategory.Apps, | ||
OutputType = typeof(List<AppMetadata>), SupportedPlatform = CmdletSupportedPlatform.Online)] | ||
[CmdletExample(Code = @"PS:> Get-PnPAvailableApp", Remarks = @"This will return all available app metadata from the tenant app catalog. It will list the installed version in the current site.", SortOrder = 1)] | ||
[CmdletExample(Code = @"PS:> Get-PnPAvailableApp -Identity 2646ccc3-6a2b-46ef-9273-81411cbbb60f", Remarks = @"This will the specific app metadata from the app catalog.", SortOrder = 2)] | ||
public class GetApp : PnPCmdlet | ||
{ | ||
[Parameter(Mandatory = false, Position = 0, ValueFromPipeline = true, HelpMessage = "Specifies the Id of an app which is available in the app catalog")] | ||
public GuidPipeBind Identity; | ||
|
||
protected override void ExecuteCmdlet() | ||
{ | ||
var manager = new AppManager(ClientContext); | ||
|
||
var apps = manager.GetAvailable(); | ||
if (MyInvocation.BoundParameters.ContainsKey("Identity")) | ||
{ | ||
var app = apps.FirstOrDefault(a => a.Id == Identity.Id); | ||
|
||
if (app != null) | ||
{ | ||
WriteObject(app); | ||
} | ||
else | ||
{ | ||
throw new System.Exception("App not found"); | ||
} | ||
} | ||
else | ||
{ | ||
WriteObject(apps); | ||
} | ||
} | ||
} | ||
} | ||
#endif |
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
Oops, something went wrong.