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

Commit ff8fef6

Browse files
Merge pull request #1643 from SharePoint/dev
July 2018 Release
2 parents f05a9fc + 55c4fee commit ff8fef6

File tree

6 files changed

+40
-17
lines changed

6 files changed

+40
-17
lines changed

CHANGELOG.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55

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

8-
## [2.28.1807.0] Unreleased
8+
## [2.29.1808.0] unreleased
99
### Added
1010

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

1515
### Contributors
1616

17+
## [2.28.1807.0]
18+
### Changed
19+
- Added IncludeClassification to Get-PnPUnifiedGroup
20+
- Updated documentation for Get-PnPSearchCrawlLog
21+
- Added -NewFileName to Add-PnPFile cmdlet
22+
23+
### Contributors
24+
- vipulkelkar
25+
- wobba
26+
- koenzomers
27+
1728
## [2.27.1806.0]
1829
### Added
1930
- Added Grant-PnPTenantServicePrincipalPermission to explicitely grant a permission on a resource for the tenant.

Commands/Base/PipeBinds/UnifiedGroupPipeBind.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,23 @@ public UnifiedGroupPipeBind(String input)
4242

4343
public String GroupId => (_groupId);
4444

45-
public UnifiedGroupEntity GetGroup(string accessToken)
45+
public UnifiedGroupEntity GetGroup(string accessToken, bool includeClassification = false)
4646
{
4747
UnifiedGroupEntity group = null;
4848
if (Group != null)
4949
{
50-
group = UnifiedGroupsUtility.GetUnifiedGroup(Group.GroupId, accessToken);
50+
group = UnifiedGroupsUtility.GetUnifiedGroup(Group.GroupId, accessToken, includeClassification:includeClassification);
5151
}
5252
else if (!String.IsNullOrEmpty(GroupId))
5353
{
54-
group = UnifiedGroupsUtility.GetUnifiedGroup(GroupId, accessToken);
54+
group = UnifiedGroupsUtility.GetUnifiedGroup(GroupId, accessToken, includeClassification:includeClassification);
5555
}
5656
else if (!string.IsNullOrEmpty(DisplayName))
5757
{
58-
var groups = UnifiedGroupsUtility.ListUnifiedGroups(accessToken, DisplayName, includeSite: true);
58+
var groups = UnifiedGroupsUtility.ListUnifiedGroups(accessToken, DisplayName, includeSite: true, includeClassification:includeClassification);
5959
if (groups == null || groups.Count == 0)
6060
{
61-
groups = UnifiedGroupsUtility.ListUnifiedGroups(accessToken, mailNickname: DisplayName, includeSite: true);
61+
groups = UnifiedGroupsUtility.ListUnifiedGroups(accessToken, mailNickname: DisplayName, includeSite: true, includeClassification:includeClassification);
6262
}
6363
if (groups != null && groups.Any())
6464
{

Commands/Files/AddFile.cs

+16-7
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
using SharePointPnP.PowerShell.CmdletHelpAttributes;
77
using SharePointPnP.PowerShell.Commands.Base.PipeBinds;
88
using System;
9-
using System.Linq;
10-
using System.Collections.Generic;
11-
using Microsoft.SharePoint.Client.Taxonomy;
129
using SharePointPnP.PowerShell.Commands.Utilities;
1310
using SharePointPnP.PowerShell.Commands.Enums;
1411

@@ -43,6 +40,10 @@ namespace SharePointPnP.PowerShell.Commands.Files
4340
Code = @"PS:> Add-PnPFile -FileName sample.docx -Folder ""Documents"" -Values @{Modified=""1/1/2016""; Created=""1/1/2017""; Editor=23}",
4441
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.",
4542
SortOrder = 6)]
43+
[CmdletExample(
44+
Code = @"PS:> Add-PnPFile -FileName sample.docx -Folder ""Documents"" -NewFileName ""differentname.docx""",
45+
Remarks = "This will upload a local file sample.docx to the Documents folder giving it the filename differentname.docx on SharePoint",
46+
SortOrder = 7)]
4647

4748
public class AddFile : PnPWebCmdlet
4849
{
@@ -57,10 +58,13 @@ public class AddFile : PnPWebCmdlet
5758

5859
[Parameter(Mandatory = true, ParameterSetName = ParameterSet_ASSTREAM, HelpMessage = "Name for file")]
5960
public string FileName = string.Empty;
61+
62+
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_ASFILE, HelpMessage = "Filename to give the file on SharePoint")]
63+
public string NewFileName = string.Empty;
64+
6065
[Parameter(Mandatory = true, ParameterSetName = ParameterSet_ASSTREAM, HelpMessage = "Stream with the file contents")]
6166
public Stream Stream;
6267

63-
6468
[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.")]
6569
public SwitchParameter Checkout;
6670

@@ -109,14 +113,20 @@ public class AddFile : PnPWebCmdlet
109113

110114
protected override void ExecuteCmdlet()
111115
{
112-
113116
if (ParameterSetName == ParameterSet_ASFILE)
114117
{
115118
if (!System.IO.Path.IsPathRooted(Path))
116119
{
117120
Path = System.IO.Path.Combine(SessionState.Path.CurrentFileSystemLocation.Path, Path);
118121
}
119-
FileName = System.IO.Path.GetFileName(Path);
122+
if (string.IsNullOrEmpty(NewFileName))
123+
{
124+
FileName = System.IO.Path.GetFileName(Path);
125+
}
126+
else
127+
{
128+
FileName = NewFileName;
129+
}
120130
}
121131

122132
SelectedWeb.EnsureProperty(w => w.ServerRelativeUrl);
@@ -128,7 +138,6 @@ protected override void ExecuteCmdlet()
128138
//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.
129139
if (ContentType != null)
130140
{
131-
132141
try
133142
{
134143
var list = SelectedWeb.GetListByUrl(folder.ServerRelativeUrl);

Commands/Graph/GetUnifiedGroup.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ public class GetUnifiedGroup : PnPGraphCmdlet
4646
[Parameter(Mandatory = false, HelpMessage = "Exclude fetching the site URL for Office 365 Groups. This speeds up large listings.")]
4747
public SwitchParameter ExcludeSiteUrl;
4848

49+
[Parameter(Mandatory = false, HelpMessage = "Include Classification value of Office 365 Groups.")]
50+
public SwitchParameter IncludeClassification;
51+
4952
protected override void ExecuteCmdlet()
5053
{
5154
UnifiedGroupEntity group = null;
@@ -58,7 +61,7 @@ protected override void ExecuteCmdlet()
5861
else
5962
{
6063
// Retrieve all the groups
61-
groups = UnifiedGroupsUtility.ListUnifiedGroups(AccessToken, includeSite: !ExcludeSiteUrl.IsPresent);
64+
groups = UnifiedGroupsUtility.ListUnifiedGroups(AccessToken, includeSite: !ExcludeSiteUrl.IsPresent, includeClassification:IncludeClassification.IsPresent);
6265
}
6366

6467
if (group != null)

Commands/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@
4444
// You can specify all the values or you can default the Build and Revision Numbers
4545
// by using the '*' as shown below:
4646
// [assembly: AssemblyVersion("1.0.*")]
47-
[assembly: AssemblyVersion("2.27.1806.1")]
48-
[assembly: AssemblyFileVersion("2.27.1806.1")]
47+
[assembly: AssemblyVersion("2.28.1807.0")]
48+
[assembly: AssemblyFileVersion("2.28.1807.0")]
4949
[assembly: InternalsVisibleTo("SharePointPnP.PowerShell.Tests")]

Commands/Search/GetSearchCrawlLog.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class CrawlEntry
4242
Remarks = "Returns the last 100 crawl log entries for site content.",
4343
SortOrder = 1)]
4444
[CmdletExample(
45-
Code = @"PS:> Get-PnPSearchCrawlLog ""https://<tenant>-my.sharepoint.com/personal""",
45+
Code = @"PS:> Get-PnPSearchCrawlLog -Filter ""https://<tenant>-my.sharepoint.com/personal""",
4646
Remarks = "Returns the last 100 crawl log entries for OneDrive content.",
4747
SortOrder = 2)]
4848
[CmdletExample(

0 commit comments

Comments
 (0)