Skip to content

Commit 013c074

Browse files
authored
Merge pull request #4660 from NishkalankBezawada/NewCommandLet-Tenant-Get-Pronouns
💡New cmdlet - Get Tenant Pronouns Settings
2 parents 954a688 + ed94c1e commit 013c074

File tree

6 files changed

+192
-0
lines changed

6 files changed

+192
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
5050
- Added `Get-PnPFileRetentionLabel` cmdlet to fetch the file retention labels. [#4603](https://github.com/pnp/powershell/pull/4603)
5151
- Added `Get/Set/Remove-PnPUserProfilePhoto` cmdlets to download, upload or remove the profile photo of the specified user.
5252
- Added `New/Get/Remove/Update-PnPTodoList` cmdlets to manage Todo lists.
53+
- Added `Get-PnPTenantPronounsSetting` and `Set-PnPTenantPronounsSetting` cmdlets to manage the availability of using pronouns in the organization [#4660](https://github.com/pnp/powershell/pull/4660)
5354

5455
### Changed
5556

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
Module Name: PnP.PowerShell
3+
schema: 2.0.0
4+
applicable: SharePoint Online
5+
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPTenantPronounsSetting.html
6+
external help file: PnP.PowerShell.dll-Help.xml
7+
title: Get-PnPTenantPronounsSetting
8+
---
9+
10+
# Get-PnPTenantPronounsSetting
11+
12+
## SYNOPSIS
13+
14+
**Required Permissions**
15+
16+
* Microsoft Graph API : One of PeopleSettings.Read.All, PeopleSettings.ReadWrite.All
17+
18+
Retrieve the current setting for the availability of using pronouns in the organization
19+
20+
## SYNTAX
21+
22+
```powershell
23+
Get-PnPTenantPronounsSetting [-Connection <PnPConnection>]
24+
```
25+
26+
## DESCRIPTION
27+
28+
This cmdlet can be used to retrieve tenant wide pronounsSettings properties.
29+
30+
## EXAMPLES
31+
32+
### EXAMPLE 1
33+
```powershell
34+
Get-PnPTenantPronounsSetting
35+
```
36+
37+
Retrieves the tenant-wide pronouns settings
38+
39+
## PARAMETERS
40+
41+
### -Connection
42+
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](Get-PnPConnection.md).
43+
44+
```yaml
45+
Type: PnPConnection
46+
Parameter Sets: (All)
47+
Required: False
48+
Position: Named
49+
Default value: None
50+
Accept pipeline input: False
51+
Accept wildcard characters: False
52+
```
53+
54+
## RELATED LINKS
55+
56+
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
57+
[Microsoft Graph documentation](https://learn.microsoft.com/graph/api/peopleadminsettings-list-pronouns)
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
Module Name: PnP.PowerShell
3+
schema: 2.0.0
4+
applicable: SharePoint Online
5+
online version: https://pnp.github.io/powershell/cmdlets/Set-PnPTenantPronounsSetting.html
6+
external help file: PnP.PowerShell.dll-Help.xml
7+
title: Set-PnPTenantPronounsSetting
8+
---
9+
10+
# Set-PnPTenantPronounsSetting
11+
12+
## SYNOPSIS
13+
14+
**Required Permissions**
15+
16+
* Microsoft Graph API : PeopleSettings.ReadWrite.All
17+
18+
Allows allowing configuring the tenant-wide pronouns settings
19+
20+
## SYNTAX
21+
22+
```powershell
23+
Set-PnPTenantPronounsSetting [-Connection <PnPConnection>]
24+
```
25+
26+
## DESCRIPTION
27+
28+
Allows allowing or disallowing users configuring their own desired pronouns in their user profile.
29+
30+
## EXAMPLES
31+
32+
### EXAMPLE 1
33+
```powershell
34+
Set-PnPTenantPronounsSetting -IsEnabledInOrganization:$true
35+
```
36+
37+
Enables allowing users to configure their own desired pronouns in their user profile.
38+
39+
### EXAMPLE 2
40+
```powershell
41+
Set-PnPTenantPronounsSetting -IsEnabledInOrganization:$false
42+
```
43+
44+
Disables users from configuring their own desired pronouns in their user profile.
45+
46+
## PARAMETERS
47+
48+
### -Connection
49+
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](Get-PnPConnection.md).
50+
51+
```yaml
52+
Type: PnPConnection
53+
Parameter Sets: (All)
54+
Required: False
55+
Position: Named
56+
Default value: None
57+
Accept pipeline input: False
58+
Accept wildcard characters: False
59+
```
60+
61+
### -IsEnabledInOrganization
62+
Provide $true to allow end users to set their desired pronounce, provide $false to prevent end users from setting their desired pronouns.
63+
64+
```yaml
65+
Type: PnPConnection
66+
Parameter Sets: (All)
67+
Required: True
68+
Position: Named
69+
Default value: None
70+
Accept pipeline input: False
71+
Accept wildcard characters: False
72+
```
73+
74+
## RELATED LINKS
75+
76+
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
77+
[Microsoft Graph documentation](https://learn.microsoft.com/graph/api/peopleadminsettings-list-pronouns)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System.Text.Json.Serialization;
2+
3+
namespace PnP.PowerShell.Commands.Model.Graph
4+
{
5+
/// <summary>
6+
/// Contains a pronounsSettings property information
7+
/// </summary>
8+
/// <remarks>See https://learn.microsoft.com/graph/api/resources/pronounssettings</remarks>
9+
public class PronounsSettings
10+
{
11+
/// <summary>
12+
/// isEnabledInOrganization property name
13+
/// </summary>
14+
[JsonPropertyName("isEnabledInOrganization")]
15+
public bool? IsPronounsEnabledInOrganization { get; set; }
16+
17+
}
18+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using PnP.PowerShell.Commands.Attributes;
2+
using PnP.PowerShell.Commands.Base;
3+
using System.Management.Automation;
4+
5+
namespace PnP.PowerShell.Commands.PronounSettings
6+
{
7+
[Cmdlet(VerbsCommon.Get, "PnPTenantPronounsSetting")]
8+
[RequiredApiDelegatedOrApplicationPermissions("graph/PeopleSettings.Read.All")]
9+
[RequiredApiDelegatedOrApplicationPermissions("graph/PeopleSettings.ReadWrite.All")]
10+
[OutputType(typeof(Model.Graph.PronounsSettings))]
11+
public class GetTenantPronounsSetting : PnPGraphCmdlet
12+
{
13+
protected override void ExecuteCmdlet()
14+
{
15+
var pronouns = RequestHelper.Get<Model.Graph.PronounsSettings>("/v1.0/admin/people/pronouns");
16+
WriteObject(pronouns, false);
17+
}
18+
}
19+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using PnP.PowerShell.Commands.Attributes;
2+
using PnP.PowerShell.Commands.Base;
3+
using System.Management.Automation;
4+
5+
namespace PnP.PowerShell.Commands.PronounSettings
6+
{
7+
[Cmdlet(VerbsCommon.Set, "PnPTenantPronounsSetting")]
8+
[RequiredApiDelegatedOrApplicationPermissions("graph/PeopleSettings.ReadWrite.All")]
9+
[OutputType(typeof(Model.Graph.PronounsSettings))]
10+
public class SetTenantPronounsSetting : PnPGraphCmdlet
11+
{
12+
[Parameter(Mandatory = true)]
13+
public bool IsEnabledInOrganization { get; set; }
14+
protected override void ExecuteCmdlet()
15+
{
16+
var pronouns = RequestHelper.Patch("/v1.0/admin/people/pronouns", new Model.Graph.PronounsSettings { IsPronounsEnabledInOrganization = IsEnabledInOrganization });
17+
WriteObject(pronouns, false);
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)