Command
Copy-TeamChannel
Description
The command to copy team channels into another team.
If you want to copy a team but only a subset of its channels, try Copy-Team with the Channel
parameter.
Index
Examples
Copy all channels of a team into another team
$source = Connect-Tenant -Domain sourcetenant $destination = Connect-Tenant -Domain destinationtenant $sourceTeam = Get-Team -Name "MyTeam" -Tenant $source $destinationTeam = Get-Team -Name "MyOtherTeam" -Tenant $destination $sourceChannels = Get-TeamChannel -Team $sourceTeam | ForEach-Object { Set-TeamChannelCopyOptions -Channel $_ -NewName ($_.Name + "Copied") } Copy-TeamChannel -Channel $sourceChannels -DestinationTeam $destinationTeam
Note: In this example your channels are renamed with the word Copied added to the title to avoid possible conflicts with existing channels.
Copy a subset of channels of a team into another team
$source = Connect-Tenant -Domain sourcetenant $destination = Connect-Tenant -Domain destinationtenant $sourceTeam = Get-Team -Name "MyTeam" -Tenant $source $destinationTeam = Get-Team -Name "MyOtherTeam" -Tenant $destination $sourceChannels = Get-TeamChannel -Team $sourceTeam -Name ChannelName* Copy-TeamChannel -Channel $sourceChannels -DestinationTeam $destinationTeam
Note: The * symbol is used to call multiple objects with a similar name.
Copy all channels and rename only General
$source = Connect-Tenant -Domain sourcetenant $destination = Connect-Tenant -Domain destinationtenant $sourceTeam = Get-Team -Name "MyTeam" -Tenant $source $destinationTeam = Get-Team -Name "MyOtherTeam" -Tenant $destination $sourceChannels = Get-TeamChannel -Team $sourceTeam $sourceChannels[0] = Set-TeamChannelCopyOptions -Channel $sourceChannels[0] -NewName GeneralCopied Copy-TeamChannel -Channel $sourceChannels -DestinationTeam $destinationTeam
Syntax
Copy-TeamChannel-Channel <TeamChannel[]>-DestinationTeam <Team> [-CopyOptions <TeamCopyOptions>][-NormalMode <SwitchParameter>] [-MappingSettings <MappingSettings>] [-TaskName <String>]
Parameters
-Channel <TeamChannel[]>
Specifies the channel to copy.
Required? | True |
Default value | None |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-CopyOptions <TeamCopyOptions>
Specifies the team copy options.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-DestinationTeam <Team>
Specifies the destination team.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-MappingSettings <MappingSettings>
Specifies the mapping settings.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-NormalMode <SwitchParameter>
Specifies that the normal mode should be used. Note: Insane mode is always used by default in PowerShell.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-TaskName <String>
Specifies a name for the task.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |