Skip to content

Add PolicyId output to Get-TeamViewerGroup function - #102

Open
fs1n wants to merge 1 commit into
teamviewer:mainfrom
fs1n:feature/OutputPolicyIDforGroup
Open

Add PolicyId output to Get-TeamViewerGroup function#102
fs1n wants to merge 1 commit into
teamviewer:mainfrom
fs1n:feature/OutputPolicyIDforGroup

Conversation

@fs1n

@fs1n fs1n commented Jun 29, 2026

Copy link
Copy Markdown

Summary

This PR adds the PolicyId field to the output of the Get-TeamViewerGroup function. This enhancement enables retreival of the PolicyID, assigned to a group via the Get-TeamViewerGroup -Id <groupID> cmdlet.

Changes

  • Added PolicyId field to Get-TeamViewerGroup cmdlet output
  • Updated ConvertTo-TeamViewerGroup conversion function to support the new field
  • Updated all related tests to accommodate the new field

Motivation & Context

Being able to set an Policy to a group, I thought, "Why can't I retrieve it via the PowerShell module?" In a script that I had built, I had to use Invoke-RestMethod in the middle of the script, which is a bit of a maintenance pain. So I updated the module to make this output available too.


Checklist

  • Tests have been added/updated and all tests pass
  • Changes have been tested locally
  • No breaking changes to existing functionality

@AchilleasMitos-TV AchilleasMitos-TV left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also bump the minor version of the TeamViewerPS.psd1 as well as add an entry to the CHANGELOG for it.

Comment thread Cmdlets/Public/Get-TeamViewerGroup.ps1 Outdated
else {
Write-Output ($response.groups | ConvertTo-TeamViewerGroup)
$groups = @($response.groups | ConvertTo-TeamViewerGroup)
$groups | ForEach-Object { $_.PSObject.Properties.Remove('PolicyId') }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: why don't we want the PolicyId field when requesting multiple groups?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well yes, this is very individual. Personally, I don't need this information in the all group output.
If you say you want it, I can remove my filter again.
I just wanted to keep the "general" output streamlined.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the WebApi endpoint exposes it, I don't see a reason for not including it in the Powershell's response :)

@AchilleasMitos-TV AchilleasMitos-TV left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the improvement on the Cmdlet!

Comment thread Cmdlets/Public/Get-TeamViewerGroup.ps1 Outdated
else {
Write-Output ($response.groups | ConvertTo-TeamViewerGroup)
$groups = @($response.groups | ConvertTo-TeamViewerGroup)
$groups | ForEach-Object { $_.PSObject.Properties.Remove('PolicyId') }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the WebApi endpoint exposes it, I don't see a reason for not including it in the Powershell's response :)

Comment thread Cmdlets/TeamViewerPS.psd1
Comment thread CHANGELOG.md
@fs1n

fs1n commented Jul 12, 2026

Copy link
Copy Markdown
Author

Hi @AchilleasMitos-TV

I've incorporated all of your feedback in my last comit. Now it should be ready to merge.

For the release process: Should I open an issue to request a release, or should I reach out to @ChristianJ-TV or @stefanhubertus directly (e.g. via E-Mail)? A contribution guide covering this would be helpful!

Thanks for the review!

@AchilleasMitos-TV

Copy link
Copy Markdown
Collaborator

@fs1n an email would do just fine :)

As a last thing, please also make sure to clean up the git history appropriately.

@fs1n
fs1n force-pushed the feature/OutputPolicyIDforGroup branch from ea64b3a to 68e1bc5 Compare July 13, 2026 19:04
@fs1n

fs1n commented Jul 13, 2026

Copy link
Copy Markdown
Author

Done.

@stefanhubertus

stefanhubertus commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Thank you for the contribution, @fs1n!

When we tried to prepare and plan a new release, we got blocked by the latest version of Pester which requires a few (small but impactful) changes. The PR to do that is now merged. Could you please rebase your branch to the current main and resolve the conflicts? If there are issues with the Pester test runs see this guide for further information: https://pester.dev/docs/migrations/v5-to-v6

Could you also add your changes to the unreleased list of 2.5.1? We are not yet sure which version the release actually will have, but we would put yours inside that, too.

@fs1n

fs1n commented Jul 27, 2026

Copy link
Copy Markdown
Author

Hi @stefanhubertus
Sure thing! I will revert to version 2.5.1 and rebase with the current main. I maybe need until the end of the week.

@ChristianJ-TV ChristianJ-TV added the Improvement Indicates an improvement for existing functionality label Jul 27, 2026
@stefanhubertus

stefanhubertus commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Hi @stefanhubertus Sure thing! I will revert to version 2.5.1 and rebase with the current main. I maybe need until the end of the week.

Actually I meant 2.5.2, sorry for the typo/confusion 😅 Just add it to the latest, not released version in the changelog.

@fs1n
fs1n force-pushed the feature/OutputPolicyIDforGroup branch from 68e1bc5 to 4e01850 Compare July 28, 2026 16:55
@fs1n

fs1n commented Jul 28, 2026

Copy link
Copy Markdown
Author

@stefanhubertus
I quickly merged my changes and the pester tests for the Get-TeamViewerGroup cmdlet seem to run as expected. It should now be ready for merge and release.

Today, I found some other things I may want to contribute. As you don't seem to have a release cycle, can I expect another release in the near future for contributions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement Indicates an improvement for existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants