
This is an archive version of the document. To get the most up-to-date information, see the
current version.
Export-VETPost
Exports Microsoft Teams posts.
Product Edition: Community, Standard, Enterprise, Enterprise Plus
This cmdlet provides parameter sets that allow you to:
Export-VETPost [-Post] <VETPost[]> [-Path] <string> [-Force] [<CommonParameters>] |
- Export posts of a specified channel.
Export-VETPost [-Channel] <VETChannel> [-Path] <string> [-From] <DateTime> [[-To] <DateTime>] [-Force] [<CommonParameters>] |
This cmdlet exports posts published in Microsoft Teams team channels to HTML files.
Parameter | Description | Type | Required | Position | Accept Pipeline Input | Accept Wildcard Characters |
---|
Post | Specifies Microsoft Teams team channel posts that you want to export. | Accepts the VETPost[] type. To get this object, run the Get-VETPost cmdlet. | True | 0 | True (ByValue) | False |
Channel | Specifies a Microsoft Teams team channel. The cmdlet will export posts from this channel. | Accepts the VETChannel object. To get this object, run the Get-VETChannel cmdlet. | True | 0 | True (ByValue) | False |
Path | Specifies a path to the folder and a name for the HTML file where you want to export posts. | String | True | 1 | False | False |
Force | Defines that the cmdlet will create the folder where to save the HTML file if the specified folder does not exist. | SwitchParameter | False | Named | False | False |
From | Specifies the point in time that defines the start of the period for which you want to export posts. The cmdlet will export posts created within the specified time period. | DateTime | False | 2 | False | False |
To | Specifies the point in time that defines the end of the period for which you want to export posts. The cmdlet will export posts created within the specified time period. | DateTime | False | 3 | False | False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About Common Parameters section of Microsoft Docs.
None.
This example shows how to export specified posts. The cmdlet will export posts with the following settings: - The cmdlet will export posts from channels of the IT team that contain the announcement keyword.
- The cmdlet will export posts to the announcements.html file.
$session = Get-VBOTeamsItemRestoreSession $org = Get-VETOrganization -Session $session -Name "ABC" $team = Get-VETTeam -Organization $org -DisplayName "IT" $post = Get-VETPost -team $team -Query "subject: announcement" Export-VETPost -Post $post -Path "C:\export\announcements.html" |
Perform the following steps: - Get posts that contain the announcement keyword:
- Run the Get-VBOTeamsItemRestoreSession cmdlet. Save the result to the $session variable.
- Run the Get-VETOrganization cmdlet. Set the $session variable as the Session parameter value. Specify the Name parameter value. Save the result to the $org variable.
- Run the Get-VETTeam cmdlet. Set the $org variable as the Organization parameter value. Specify the DisplayName parameter value. Save the result to the $team variable.
- Run the Get-VETPost cmdlet. Set the $team variable as the Team parameter value. Specify the Query parameter value. Save the result to the $post variable.
- Run the Export-VETPost cmdlet. Set the $post variable as the Post parameter value. Specify the Path parameter value.
|
This example shows how to export posts of the specified channel. The cmdlet will export posts with the following settings: - The cmdlet will export posts from the General channel of the IT team.
- The cmdlet will export posts published between 7/1/2020 10:00 AM and 8/31/2020 10:00 AM to the announcements.html file.
$datefrom = [datetime]"7/1/2020 10:00 AM" $dateto = [datetime]"8/31/2020 10:00 AM" $session = Get-VBOTeamsItemRestoreSession $org = Get-VETOrganization -Session $session -Name "ABC" $team = Get-VETTeam -Organization $org -DisplayName "IT" $channel = Get-VETChannel -Team $team -DisplayName "General" Export-VETPost -Channel $channel -Path "C:\export\posts.html" -From $datefrom -To $dateto |
Perform the following steps: - Convert the time that defines the start of the period for which you want to export posts to the DateTime format. Save the result to the $datefrom variable.
- Convert the time that defines the end of the period for which you want to export posts to the DateTime format. Save the result to the $dateto variable.
- Get the General channel:
- Run the Get-VBOTeamsItemRestoreSession cmdlet. Save the result to the $session variable.
- Run the Get-VETOrganization cmdlet. Set the $session variable as the Session parameter value. Specify the Name parameter value. Save the result to the $org variable.
- Run the Get-VETTeam cmdlet. Set the $org variable as the Organization parameter value. Specify the DisplayName parameter value. Save the result to the $team variable.
- Run the Get-VETChannel cmdlet. Set the $team variable as the Team parameter value. Specify the DisplayName parameter value. Save the result to the $channel variable.
- Run the Export-VETPost cmdlet. Set the $channel variable as the Channel parameter value. Specify the Path parameter value. Set the $datefrom variable as the From parameter value. Set the $dateto variable as the To parameter value.
|
Related Commands