Skip to content

Commit

Permalink
!deploy v2.15.4 with updates and private function cleanup and resolve #…
Browse files Browse the repository at this point in the history
…96

## 2.15.4

* [Issue #96](#96)
  * Updated the following on `Get-GSGroup`:
    * Set default scope to `Customer` so that getting the list of groups expectedly gets all of them, not just the ones in your primary domain
    * Added `Domain` parameter to specify which domain to list groups from your customer account
    * Added `Filter` parameter to only list groups matching the Group query syntax
    * Moved the `Get-GSGroupListPrivate` private function into the body of `Get-GSGroup` for error clarity
* Others:
  * Moved the `Get-GSUserListPrivate` private function into the body of `Get-GSUser` for error clarity
  * Improved error handling for User and Message List functions when there are no results.
  • Loading branch information
scrthq authored Oct 12, 2018
2 parents e5d42b6 + 6028756 commit a77dc12
Show file tree
Hide file tree
Showing 8 changed files with 312 additions and 338 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changelog

* [2.15.4](#2154)
* [2.15.3](#2153)
* [2.15.2](#2152)
* [2.15.1](#2151)
Expand Down Expand Up @@ -49,6 +50,18 @@
* [Functions Removed](#functions-removed)
* [Functions Aliased](#functions-aliased)

## 2.15.4

* [Issue #96](https://github.com/scrthq/PSGSuite/issues/96)
* Updated the following on `Get-GSGroup`:
* Set default scope to `Customer` so that getting the list of groups expectedly gets all of them, not just the ones in your primary domain
* Added `Domain` parameter to specify which domain to list groups from your customer account
* Added `Filter` parameter to only list groups matching the Group query syntax
* Moved the `Get-GSGroupListPrivate` private function into the body of `Get-GSGroup` for error clarity
* Others:
* Moved the `Get-GSUserListPrivate` private function into the body of `Get-GSUser` for error clarity
* Improved error handling for User and Message List functions when there are no results.

## 2.15.3

* [Issue #87](https://github.com/scrthq/PSGSuite/issues/87)
Expand Down
2 changes: 1 addition & 1 deletion PSGSuite/PSGSuite.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'PSGSuite.psm1'

# Version number of this module.
ModuleVersion = '2.15.3'
ModuleVersion = '2.15.4'

# ID used to uniquely identify this module
GUID = '9d751152-e83e-40bb-a6db-4c329092aaec'
Expand Down
76 changes: 0 additions & 76 deletions PSGSuite/Private/ListPrivate/Get-GSGroupListPrivate.ps1

This file was deleted.

152 changes: 0 additions & 152 deletions PSGSuite/Private/ListPrivate/Get-GSUserListPrivate.ps1

This file was deleted.

76 changes: 39 additions & 37 deletions PSGSuite/Public/Gmail/Get-GSGmailMessageList.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@ function Get-GSGmailMessageList {
<#
.SYNOPSIS
Gets a list of messages
.DESCRIPTION
Gets a list of messages
.PARAMETER User
The primary email of the user to list messages for
Defaults to the AdminEmail user
.PARAMETER Filter
Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread"
More info on Gmail search operators here: https://support.google.com/mail/answer/7190?hl=en
.PARAMETER LabelIds
Only return messages with labels that match all of the specified label IDs
.PARAMETER ExcludeChats
Exclude chats from the message list
.PARAMETER IncludeSpamTrash
Include messages from SPAM and TRASH in the results
.PARAMETER PageSize
The page size of the result set
.EXAMPLE
Get-GSGmailMessageList -Filter "to:me","after:2017/12/25" -ExcludeChats
Expand All @@ -36,28 +36,28 @@ function Get-GSGmailMessageList {
[cmdletbinding()]
Param
(
[parameter(Mandatory=$false,ValueFromPipelineByPropertyName = $true)]
[Alias("PrimaryEmail","UserKey","Mail")]
[String]
$User = $Script:PSGSuite.AdminEmail,
[parameter(Mandatory=$false)]
[Alias('Query')]
[String[]]
$Filter,
[parameter(Mandatory=$false)]
[Alias('LabelId')]
[String[]]
$LabelIds,
[parameter(Mandatory=$false)]
[switch]
$ExcludeChats,
[parameter(Mandatory=$false)]
[switch]
$IncludeSpamTrash,
[parameter(Mandatory=$false)]
[ValidateRange(1,500)]
[Int]
$PageSize="500"
[parameter(Mandatory = $false,ValueFromPipelineByPropertyName = $true)]
[Alias("PrimaryEmail","UserKey","Mail")]
[String]
$User = $Script:PSGSuite.AdminEmail,
[parameter(Mandatory = $false)]
[Alias('Query')]
[String[]]
$Filter,
[parameter(Mandatory = $false)]
[Alias('LabelId')]
[String[]]
$LabelIds,
[parameter(Mandatory = $false)]
[switch]
$ExcludeChats,
[parameter(Mandatory = $false)]
[switch]
$IncludeSpamTrash,
[parameter(Mandatory = $false)]
[ValidateRange(1,500)]
[Int]
$PageSize = "500"
)
Process {
try {
Expand All @@ -73,12 +73,12 @@ function Get-GSGmailMessageList {
ServiceType = 'Google.Apis.Gmail.v1.GmailService'
User = $U
}
if ($ExcludeChats){
if($Filter){
$Filter+="-in:chats"
if ($ExcludeChats) {
if ($Filter) {
$Filter += "-in:chats"
}
else{
$Filter="-in:chats"
else {
$Filter = "-in:chats"
}
}
$service = New-GoogleService @serviceParams
Expand Down Expand Up @@ -110,7 +110,9 @@ function Get-GSGmailMessageList {
[int]$i = 1
do {
$result = $request.Execute()
$result.Messages | Add-Member -MemberType NoteProperty -Name 'User' -Value $U -PassThru | Add-Member -MemberType NoteProperty -Name 'Filter' -Value $Filter -PassThru
if ($result.Messages) {
$result.Messages | Add-Member -MemberType NoteProperty -Name 'User' -Value $U -PassThru | Add-Member -MemberType NoteProperty -Name 'Filter' -Value $Filter -PassThru
}
if ($result.NextPageToken) {
$request.PageToken = $result.NextPageToken
}
Expand All @@ -130,4 +132,4 @@ function Get-GSGmailMessageList {
}
}
}
}
}
Loading

0 comments on commit a77dc12

Please sign in to comment.