Skip to content

Commit

Permalink
Merge branch 'dev' into Get-PnPFileFolderInFolderRename
Browse files Browse the repository at this point in the history
  • Loading branch information
KoenZomers authored Sep 27, 2023
2 parents de3a02c + 829c657 commit 7f8e70a
Show file tree
Hide file tree
Showing 29 changed files with 4,129 additions and 3,402 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `Get-PnPFlowOwner` cmdlet which allows retrieving the owners of a Power Automate flow [#3314](https://github.com/pnp/powershell/pull/3314)
- Added `-AvailableForTagging` to `Set-PnPTerm` which allows the available for tagging property on a Term to be set [#3321](https://github.com/pnp/powershell/pull/3321)
- Added `Get-PnPPowerPlatformConnector` cmdlet which allows for all custom connectors to be retrieved [#3309](https://github.com/pnp/powershell/pull/3309)
- Added option to pass in a Stream or XML string to `Read-PnPTenantTemplate` allowing the tenant template to be modified before being applied. [#3431](https://github.com/pnp/powershell/pull/3431)
- Added `Get-PnPTenantInfo` which allows retrieving tenant information by its Id or domain name. [#3414](https://github.com/pnp/powershell/pull/3414)
- Added option to create a Microsoft 365 Group with dynamic membership by passing in `-DynamicMembershipRule` [#3426](https://github.com/pnp/powershell/pull/3426)

### Fixed

Expand All @@ -48,20 +51,23 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Fixed `New-PnPTeamsTeam` cmdlet throwing an error when specifying members [#3351](https://github.com/pnp/powershell/pull/3351)
- Fixed `New-PnPTeamsTeam` cmdlet not working well with a managed identity [#3351](https://github.com/pnp/powershell/pull/3351)
- Fixed `Copy-PnPFile`, `Copy-PnPFolder` and `Move-PnPFile` to better handle copying or moving operations to OneDrive or Multi-geo environments. [#3245](https://github.com/pnp/powershell/pull/3245)
- Fixed `Get-PnPTenantTemplate` not doing anything when the `-SiteUrl` parameter had not been specified. It will now use the currently connected site when the parameter is omitted. [#3431](https://github.com/pnp/powershell/pull/3431)

### Changed

- Improved `Set-PnPListItem` cmdlet handling of Purview labels. [#3340](https://github.com/pnp/powershell/pull/3340)
- The `Publish-PnPCompanyApp` cmdlet is now obsolete. It will be removed in the next version. [#3349](https://github.com/pnp/powershell/pull/3349)
- Verbose output will no longer show the access token [#3352](https://github.com/pnp/powershell/pull/3352)
- Improved `Add-PnPFile` cmdlet. It will now automatically checkout the file if `-CheckinType` parameter is specified. [#3403](https://github.com/pnp/powershell/pull/3403)
- Improved the error message thrown when using `-ValidateConnection` with `Connect-PnPOnline` and it failing due to i.e. an expired ClientSecret so the reason of the failed connect becomes more clear. [#3440](https://github.com/pnp/powershell/pull/3440)

### Removed

- Removed `-DisableListSync` and `-SyncAadB2BManagementPolicy` from `Set-PnPTenant` as the underlying properties have been removed from SharePoint CSOM as well [#3388](https://github.com/pnp/powershell/pull/3388)

### Contributors

- [smsdaniel]
- Jim Duncan [sparkitect]
- Jonathan Smith [jonathan-m-smith]
- Carl Joakim Damsleth [damsleth]
Expand Down
41 changes: 40 additions & 1 deletion build/Build-HelpFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,46 @@ if($IsLinux -or $isMacOS)
{
$destinationFolder = "$documentsFolder/.local/share/powershell/Modules/PnP.PowerShell"
} else {
$destinationFolder = "$documentsFolder\PowerShell\Modules\PnP.PowerShell"
$destinationFolder = "$documentsFolder/PowerShell/Modules/PnP.PowerShell"
}

Try {
Write-Host "Generating documentation files for alias cmdlets" -ForegroundColor Yellow
# Load the Module in a new PowerShell session
$scriptBlock = {
$documentsFolder = [environment]::getfolderpath("mydocuments")
if($IsLinux -or $isMacOS)
{
$destinationFolder = "$documentsFolder/.local/share/powershell/Modules/PnP.PowerShell"
} else {
$destinationFolder = "$documentsFolder/PowerShell/Modules/PnP.PowerShell"
}
$pnpDllLocation = "$destinationFolder/Core/PnP.PowerShell.dll"

Write-Host "Importing PnP PowerShell assembly from $pnpDllLocation"
Import-Module -Name $pnpDllLocation -DisableNameChecking -Force
Write-Host "Import PnP PowerShell successful"
$cmdlets = Get-Command -Module PnP.PowerShell | Where-Object CommandType -eq "Alias" | Select-Object -Property @{N="Alias";E={$_.Name}}, @{N="ReferencedCommand";E={$_.ReferencedCommand.Name}}
$cmdlets
Write-Host "Retrieved alias cmdlets successfully"
}
$aliasCmdlets = Start-ThreadJob -ScriptBlock $scriptBlock | Receive-Job -Wait

Write-Host " - $($aliasCmdlets.Length) found" -ForegroundColor Yellow

$aliasTemplatePageContent = Get-Content -Path "../pages/cmdlets/alias.md" -Raw

ForEach($aliasCmdlet in $aliasCmdlets)
{
$destinationFileName = "./../documentation/$($aliasCmdlet.Alias).md"

Write-Host " - Creating page for $($aliasCmdlet.Alias) being an alias for $($aliasCmdlet.ReferencedCommand) as $destinationFileName" -ForegroundColor Yellow
$aliasTemplatePageContent.Replace("%%cmdletname%%", $aliasCmdlet.Alias).Replace("%%referencedcmdletname%%", $aliasCmdlet.ReferencedCommand) | Out-File $destinationFileName -Force
}
}
Catch {
Write-Host "Error: Cannot generate alias documentation files"
Write-Host $_
}

$tempFolder = [System.IO.Path]::GetTempPath()
Expand Down
30 changes: 22 additions & 8 deletions documentation/Add-PnPMicrosoft365GroupMember.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ title: Add-PnPMicrosoft365GroupMember

* Microsoft Graph API: All of Group.ReadWrite.All, User.ReadWrite.All

Adds members to a particular Microsoft 365 Group
Adds members to a particular Microsoft 365 Group.

## SYNTAX

```powershell
Add-PnPMicrosoft365GroupMember -Identity <Microsoft365GroupPipeBind> -Users <String[]> [-RemoveExisting]
Add-PnPMicrosoft365GroupMember -Identity <Microsoft365GroupPipeBind> -Users <String[]> [-RemoveExisting] [-Connection <PnPConnection>]
```

## DESCRIPTION
Expand All @@ -34,19 +34,33 @@ Allows to add multiple users to Microsoft 365 Group.
Add-PnPMicrosoft365GroupMember -Identity "Project Team" -Users "[email protected]","[email protected]"
```

Adds the provided two users as additional members to the Microsoft 365 Group named "Project Team"
Adds the provided two users as additional members to the Microsoft 365 Group named "Project Team".

### EXAMPLE 2
```powershell
Add-PnPMicrosoft365GroupMember -Identity "Project Team" -Users "[email protected]","[email protected]" -RemoveExisting
```

Sets the provided two users as the only members of the Microsoft 365 Group named "Project Team" by removing any current existing members first
Sets the provided two users as the only members of the Microsoft 365 Group named "Project Team" by removing any current existing members first.

## PARAMETERS

### -Connection
Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

```yaml
Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Identity
The Identity of the Microsoft 365 Group to add members to
The Identity of the Microsoft 365 Group to add members to.
```yaml
Type: Microsoft365GroupPipeBind
Expand All @@ -60,7 +74,7 @@ Accept wildcard characters: False
```
### -RemoveExisting
If provided, all existing members will be removed and only those provided through Users will become members
If provided, all existing members will be removed and only those provided through Users will become members.
```yaml
Type: SwitchParameter
Expand All @@ -74,7 +88,7 @@ Accept wildcard characters: False
```
### -Users
The UPN(s) of the user(s) to add to the Microsoft 365 Group as a member
The UPN(s) of the user(s) to add to the Microsoft 365 Group as a member.
```yaml
Type: String[]
Expand All @@ -90,4 +104,4 @@ Accept wildcard characters: False
## RELATED LINKS
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
[Microsoft Graph documentation](https://learn.microsoft.com/graph/api/group-post-members)
[Microsoft Graph documentation](https://learn.microsoft.com/graph/api/group-post-members)
26 changes: 20 additions & 6 deletions documentation/Add-PnPMicrosoft365GroupOwner.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Adds users to a Microsoft 365 Group as Owners.
## SYNTAX

```powershell
Add-PnPMicrosoft365GroupOwner -Identity <Microsoft365GroupPipeBind> -Users <String[]> [-RemoveExisting]
Add-PnPMicrosoft365GroupOwner -Identity <Microsoft365GroupPipeBind> -Users <String[]> [-RemoveExisting] [-Connection <PnPConnection>]
```

## DESCRIPTION
Expand All @@ -34,19 +34,33 @@ Allows to add multiple users to Microsoft 365 Group as owners.
Add-PnPMicrosoft365GroupOwner -Identity "Project Team" -Users "[email protected]","[email protected]"
```

Adds the provided two users as additional owners to the Microsoft 365 Group named "Project Team"
Adds the provided two users as additional owners to the Microsoft 365 Group named "Project Team".

### EXAMPLE 2
```powershell
Add-PnPMicrosoft365GroupOwner -Identity "Project Team" -Users "[email protected]","[email protected]" -RemoveExisting
```

Sets the provided two users as the only owners of the Microsoft 365 Group named "Project Team" by removing any current existing members first
Sets the provided two users as the only owners of the Microsoft 365 Group named "Project Team" by removing any current existing members first.

## PARAMETERS

### -Connection
Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

```yaml
Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Identity
The Identity of the Microsoft 365 Group to add owners to
The Identity of the Microsoft 365 Group to add owners to.
```yaml
Type: Microsoft365GroupPipeBind
Expand All @@ -60,7 +74,7 @@ Accept wildcard characters: False
```
### -RemoveExisting
If provided, all existing owners will be removed and only those provided through Users will become owners
If provided, all existing owners will be removed and only those provided through Users parameter will become owners.
```yaml
Type: SwitchParameter
Expand All @@ -74,7 +88,7 @@ Accept wildcard characters: False
```
### -Users
The UPN(s) of the user(s) to add to the Microsoft 365 Group as an owner
The UPN(s) of the user(s) to add to the Microsoft 365 Group as an owner.
```yaml
Type: String[]
Expand Down
126 changes: 126 additions & 0 deletions documentation/Get-PnPTenantInfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
Module Name: PnP.PowerShell
title: Get-PnPTenantInfo
schema: 2.0.0
applicable: SharePoint Online
external help file: PnP.PowerShell.dll-Help.xml
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPTenantInfo.html
---

# Get-PnPTenantInfo

## SYNOPSIS
Gets information about any tenant

## SYNTAX

### Current Tenant (default)
```powershell
Get-PnPTenantInfo [-Verbose]
```

### By TenantId
```powershell
Get-PnPTenantInfo -TenantId <String> [-Verbose]
```

### By Domain Name
```powershell
Get-PnPTenantInfo -DomainName <String> [-Verbose]
```

## DESCRIPTION

Gets the tenantId, federation brand name, company name and default domain name regarding a specific tenant. If no Domain name or Tenant id is specified, it returns the Tenant Info of the currently connected to tenant.

## EXAMPLES

### EXAMPLE 1
```powershell
Get-PnPTenantInfo -TenantId "e65b162c-6f87-4eb1-a24e-1b37d3504663"
```

Returns the tenant information of the specified TenantId.

### EXAMPLE 2
```powershell
Get-PnPTenantInfo -DomainName "contoso.com"
```

Returns the Tenant Information for the tenant connected to the domain contoso.com.

### EXAMPLE 3
```powershell
Get-PnPTenantInfo
```

Returns Tenant Information of the currently connected to tenant.

### EXAMPLE 4
```powershell
Get-PnPTenantInfo -CurrentTenant
```

Returns Tenant Information of the currently connected to tenant.

## PARAMETERS

### -CurrentTenant
Gets the Tenant Information of the currently connected to tenant.

```yaml
Type: SwitchParameter
Parameter Sets: GETINFOOFCURRENTTENANT

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -DomainName
The Domain name of the tenant to lookup. You can use the onmicrosoft.com domain name such as "contoso.onmicrosoft.com" or use any domain that is connected to the tenant, i.e. "contoso.com".
```yaml
Type: String
Parameter Sets: GETINFOBYTDOMAINNAME

Required: False
Position: Named
Default value: Production
Accept pipeline input: False
Accept wildcard characters: False
```
### -TenantId
The id of the tenant to retrieve the information about
```yaml
Type: String
Parameter Sets: GETINFOBYTENANTID

Required: true
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Verbose
When provided, additional debug statements will be shown while executing the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
## RELATED LINKS
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
3 changes: 2 additions & 1 deletion documentation/Get-PnPTenantTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Allows to generate a provisioning tenant template from a site. If the site is a
Get-PnPTenantTemplate -Out tenanttemplate.xml
```

Extracts a tenant template
Extracts a tenant template of the currently connected to site.

### EXAMPLE 2
```powershell
Expand Down Expand Up @@ -132,6 +132,7 @@ Accept wildcard characters: False
```
### -SiteUrl
The URL of the site collection to create a tenant template out of. If omitted, the currently connected to site will be used.
```yaml
Type: String
Expand Down
Loading

0 comments on commit 7f8e70a

Please sign in to comment.