From ed307d9ce3b36773bae5ad03890f4189d6993f17 Mon Sep 17 00:00:00 2001 From: Przemyslaw Klys Date: Sat, 21 Aug 2021 11:30:06 +0200 Subject: [PATCH] Update cmdlets --- Public/Get-O365BriefingEmail.ps1 | 23 +++++++++++++++++++- Public/Set-O365BriefingEmail.ps1 | 37 ++++++++++++++++++++++++++++++++ README.MD | 10 +++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 Public/Set-O365BriefingEmail.ps1 diff --git a/Public/Get-O365BriefingEmail.ps1 b/Public/Get-O365BriefingEmail.ps1 index aad62d862..326fdd31c 100644 --- a/Public/Get-O365BriefingEmail.ps1 +++ b/Public/Get-O365BriefingEmail.ps1 @@ -1,4 +1,20 @@ function Get-O365BriefingEmail { + <# + .SYNOPSIS + Gets status of Briefing emails. + + .DESCRIPTION + Long description + + .PARAMETER Headers + Parameter description + + .EXAMPLE + An example + + .NOTES + General notes + #> [cmdletbinding()] param( [alias('Authorization')][System.Collections.IDictionary] $Headers @@ -6,5 +22,10 @@ $Uri = "https://admin.microsoft.com/admin/api/services/apps/briefingemail" $Output = Invoke-O365Admin -Uri $Uri -Headers $Headers - $Output + if ($Output) { + [PSCustomObject] @{ + IsMailEnabled = $Output.IsMailEnabled + IsSubscribedByDefault = $Output.IsSubscribedByDefault + } + } } \ No newline at end of file diff --git a/Public/Set-O365BriefingEmail.ps1 b/Public/Set-O365BriefingEmail.ps1 new file mode 100644 index 000000000..4ab8f03b5 --- /dev/null +++ b/Public/Set-O365BriefingEmail.ps1 @@ -0,0 +1,37 @@ +function Set-O365BriefingEmail { + <# + .SYNOPSIS + Let people in your organization receive Briefing Email + + .DESCRIPTION + Let people in your organization receive Briefing Email + + .PARAMETER Headers + Parameter description + + .PARAMETER SubscribeByDefault + Subscribes or unsubscribes people in your organization to receive Briefing Email + + .EXAMPLE + An example + + .NOTES + Users will receive ‎Briefing‎ email by default, but can unsubscribe at any time from their ‎Briefing‎ email or ‎Briefing‎ settings page. Email is only sent to users if their ‎Office 365‎ language is English or Spanish. + + #> + [cmdletbinding()] + param( + [alias('Authorization')][System.Collections.IDictionary] $Headers, + #[bool] $MailEnable, + [bool] $SubscribeByDefault + ) + $Uri = "https://admin.microsoft.com/admin/api/services/apps/briefingemail" + + $Body = @{ + value = @{ + IsSubscribedByDefault = $SubscribeByDefault + } + } + $Output = Invoke-O365Admin -Uri $Uri -Headers $Headers -Method POST -Body $Body + $Output +} \ No newline at end of file diff --git a/README.MD b/README.MD index 6bbe20bdf..cc1dfd72d 100644 --- a/README.MD +++ b/README.MD @@ -56,3 +56,13 @@ That's it. Whenever there's a new version, you run the command, and you can enjo - 0.0.1 - 2021.08.19 - First version + +## Cmdlets available + +| Get cmdlet | Set cmdlet | Native API available | Description | +| --------------------------- | ----------------------- | -------------------- | --------------------------------- | +| Get-O365AzureSpeechServices | Set-AzureSpeechServices | No | Get and set Azure Speech Services | +| Get-O365Forms | Set-O365Forms | | Get and set Forms | +| Get-O365Planner | Set-O365Planner | | Get and set Planner | +| Get-O365Bookinsg | ---- | Think so | Get Bookings | +| Get-O365BriefingEmail | Set-O365BriefingEmail | No | Get and set Briefing Email |