Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1643 from SharePoint/dev
Browse files Browse the repository at this point in the history
July 2018 Release
  • Loading branch information
erwinvanhunen committed Jul 6, 2018
2 parents f05a9fc + 55c4fee commit ff8fef6
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 17 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [2.28.1807.0] Unreleased
## [2.29.1808.0] unreleased
### Added

### Changed
Expand All @@ -14,6 +14,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

### Contributors

## [2.28.1807.0]
### Changed
- Added IncludeClassification to Get-PnPUnifiedGroup
- Updated documentation for Get-PnPSearchCrawlLog
- Added -NewFileName to Add-PnPFile cmdlet

### Contributors
- vipulkelkar
- wobba
- koenzomers

## [2.27.1806.0]
### Added
- Added Grant-PnPTenantServicePrincipalPermission to explicitely grant a permission on a resource for the tenant.
Expand Down
10 changes: 5 additions & 5 deletions Commands/Base/PipeBinds/UnifiedGroupPipeBind.cs
Expand Up @@ -42,23 +42,23 @@ public UnifiedGroupPipeBind(String input)

public String GroupId => (_groupId);

public UnifiedGroupEntity GetGroup(string accessToken)
public UnifiedGroupEntity GetGroup(string accessToken, bool includeClassification = false)
{
UnifiedGroupEntity group = null;
if (Group != null)
{
group = UnifiedGroupsUtility.GetUnifiedGroup(Group.GroupId, accessToken);
group = UnifiedGroupsUtility.GetUnifiedGroup(Group.GroupId, accessToken, includeClassification:includeClassification);
}
else if (!String.IsNullOrEmpty(GroupId))
{
group = UnifiedGroupsUtility.GetUnifiedGroup(GroupId, accessToken);
group = UnifiedGroupsUtility.GetUnifiedGroup(GroupId, accessToken, includeClassification:includeClassification);
}
else if (!string.IsNullOrEmpty(DisplayName))
{
var groups = UnifiedGroupsUtility.ListUnifiedGroups(accessToken, DisplayName, includeSite: true);
var groups = UnifiedGroupsUtility.ListUnifiedGroups(accessToken, DisplayName, includeSite: true, includeClassification:includeClassification);
if (groups == null || groups.Count == 0)
{
groups = UnifiedGroupsUtility.ListUnifiedGroups(accessToken, mailNickname: DisplayName, includeSite: true);
groups = UnifiedGroupsUtility.ListUnifiedGroups(accessToken, mailNickname: DisplayName, includeSite: true, includeClassification:includeClassification);
}
if (groups != null && groups.Any())
{
Expand Down
23 changes: 16 additions & 7 deletions Commands/Files/AddFile.cs
Expand Up @@ -6,9 +6,6 @@
using SharePointPnP.PowerShell.CmdletHelpAttributes;
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;
using System;
using System.Linq;
using System.Collections.Generic;
using Microsoft.SharePoint.Client.Taxonomy;
using SharePointPnP.PowerShell.Commands.Utilities;
using SharePointPnP.PowerShell.Commands.Enums;

Expand Down Expand Up @@ -43,6 +40,10 @@ namespace SharePointPnP.PowerShell.Commands.Files
Code = @"PS:> Add-PnPFile -FileName sample.docx -Folder ""Documents"" -Values @{Modified=""1/1/2016""; Created=""1/1/2017""; Editor=23}",
Remarks = "This will add a file sample.docx to the Documents folder and will set the Modified date to 1/1/2016, Created date to 1/1/2017 and the Modified By field to the user with ID 23. To find out about the proper user ID to relate to a specific user, use Get-PnPUser.",
SortOrder = 6)]
[CmdletExample(
Code = @"PS:> Add-PnPFile -FileName sample.docx -Folder ""Documents"" -NewFileName ""differentname.docx""",
Remarks = "This will upload a local file sample.docx to the Documents folder giving it the filename differentname.docx on SharePoint",
SortOrder = 7)]

public class AddFile : PnPWebCmdlet
{
Expand All @@ -57,10 +58,13 @@ public class AddFile : PnPWebCmdlet

[Parameter(Mandatory = true, ParameterSetName = ParameterSet_ASSTREAM, HelpMessage = "Name for file")]
public string FileName = string.Empty;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_ASFILE, HelpMessage = "Filename to give the file on SharePoint")]
public string NewFileName = string.Empty;

[Parameter(Mandatory = true, ParameterSetName = ParameterSet_ASSTREAM, HelpMessage = "Stream with the file contents")]
public Stream Stream;


[Parameter(Mandatory = false, HelpMessage = "If versioning is enabled, this will check out the file first if it exists, upload the file, then check it in again.")]
public SwitchParameter Checkout;

Expand Down Expand Up @@ -109,14 +113,20 @@ public class AddFile : PnPWebCmdlet

protected override void ExecuteCmdlet()
{

if (ParameterSetName == ParameterSet_ASFILE)
{
if (!System.IO.Path.IsPathRooted(Path))
{
Path = System.IO.Path.Combine(SessionState.Path.CurrentFileSystemLocation.Path, Path);
}
FileName = System.IO.Path.GetFileName(Path);
if (string.IsNullOrEmpty(NewFileName))
{
FileName = System.IO.Path.GetFileName(Path);
}
else
{
FileName = NewFileName;
}
}

SelectedWeb.EnsureProperty(w => w.ServerRelativeUrl);
Expand All @@ -128,7 +138,6 @@ protected override void ExecuteCmdlet()
//Check to see if the Content Type exists.. If it doesn't we are going to throw an exception and block this transaction right here.
if (ContentType != null)
{

try
{
var list = SelectedWeb.GetListByUrl(folder.ServerRelativeUrl);
Expand Down
5 changes: 4 additions & 1 deletion Commands/Graph/GetUnifiedGroup.cs
Expand Up @@ -46,6 +46,9 @@ public class GetUnifiedGroup : PnPGraphCmdlet
[Parameter(Mandatory = false, HelpMessage = "Exclude fetching the site URL for Office 365 Groups. This speeds up large listings.")]
public SwitchParameter ExcludeSiteUrl;

[Parameter(Mandatory = false, HelpMessage = "Include Classification value of Office 365 Groups.")]
public SwitchParameter IncludeClassification;

protected override void ExecuteCmdlet()
{
UnifiedGroupEntity group = null;
Expand All @@ -58,7 +61,7 @@ protected override void ExecuteCmdlet()
else
{
// Retrieve all the groups
groups = UnifiedGroupsUtility.ListUnifiedGroups(AccessToken, includeSite: !ExcludeSiteUrl.IsPresent);
groups = UnifiedGroupsUtility.ListUnifiedGroups(AccessToken, includeSite: !ExcludeSiteUrl.IsPresent, includeClassification:IncludeClassification.IsPresent);
}

if (group != null)
Expand Down
4 changes: 2 additions & 2 deletions Commands/Properties/AssemblyInfo.cs
Expand Up @@ -44,6 +44,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.27.1806.1")]
[assembly: AssemblyFileVersion("2.27.1806.1")]
[assembly: AssemblyVersion("2.28.1807.0")]
[assembly: AssemblyFileVersion("2.28.1807.0")]
[assembly: InternalsVisibleTo("SharePointPnP.PowerShell.Tests")]
2 changes: 1 addition & 1 deletion Commands/Search/GetSearchCrawlLog.cs
Expand Up @@ -42,7 +42,7 @@ public class CrawlEntry
Remarks = "Returns the last 100 crawl log entries for site content.",
SortOrder = 1)]
[CmdletExample(
Code = @"PS:> Get-PnPSearchCrawlLog ""https://<tenant>-my.sharepoint.com/personal""",
Code = @"PS:> Get-PnPSearchCrawlLog -Filter ""https://<tenant>-my.sharepoint.com/personal""",
Remarks = "Returns the last 100 crawl log entries for OneDrive content.",
SortOrder = 2)]
[CmdletExample(
Expand Down

0 comments on commit ff8fef6

Please sign in to comment.