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 Outdated
Comment thread CHANGELOG.md Outdated
@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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants