diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f3bda91c..7317cdcbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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. diff --git a/Commands/Base/PipeBinds/UnifiedGroupPipeBind.cs b/Commands/Base/PipeBinds/UnifiedGroupPipeBind.cs index d78939536..3edfe901e 100644 --- a/Commands/Base/PipeBinds/UnifiedGroupPipeBind.cs +++ b/Commands/Base/PipeBinds/UnifiedGroupPipeBind.cs @@ -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()) { diff --git a/Commands/Files/AddFile.cs b/Commands/Files/AddFile.cs index 341eb459c..4293c0ec9 100644 --- a/Commands/Files/AddFile.cs +++ b/Commands/Files/AddFile.cs @@ -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; @@ -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 { @@ -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; @@ -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); @@ -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); diff --git a/Commands/Graph/GetUnifiedGroup.cs b/Commands/Graph/GetUnifiedGroup.cs index 14ac1ab21..b0ef13b78 100644 --- a/Commands/Graph/GetUnifiedGroup.cs +++ b/Commands/Graph/GetUnifiedGroup.cs @@ -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; @@ -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) diff --git a/Commands/Properties/AssemblyInfo.cs b/Commands/Properties/AssemblyInfo.cs index 8b4505d46..1f4206441 100644 --- a/Commands/Properties/AssemblyInfo.cs +++ b/Commands/Properties/AssemblyInfo.cs @@ -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")] \ No newline at end of file diff --git a/Commands/Search/GetSearchCrawlLog.cs b/Commands/Search/GetSearchCrawlLog.cs index 7dc436059..e4ffbf24b 100644 --- a/Commands/Search/GetSearchCrawlLog.cs +++ b/Commands/Search/GetSearchCrawlLog.cs @@ -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://-my.sharepoint.com/personal""", + Code = @"PS:> Get-PnPSearchCrawlLog -Filter ""https://-my.sharepoint.com/personal""", Remarks = "Returns the last 100 crawl log entries for OneDrive content.", SortOrder = 2)] [CmdletExample(