Skip to content

Commit

Permalink
v2.26.2
Browse files Browse the repository at this point in the history
## 2.26.2

* [Issue #177](#177)
  * Added: Fields parameter to Get-GSDriveFileList
* [Issue #178](#178)
  * Fixed: Start-GSDriveFileUpload failing on PowerShell 4.0
* [Issue #179](#179)
  * Added: Ims parameter to both New-GSUser and Update-GSUser
  * Added: Add-GSUserIm function to create correct type for new Ims parameter.
* Miscellaneous
  * Added: Clear-PSGSuiteServiceCache to clear the cache and dispose of any remaining open web clients.
  * Improved overall service caching.
  * Added: Support for Cloud-Identity licenses for Get-GSUserLicense
  * Added: OutputType for all applicable Helper functions (i.e. Add-GSUserIm)
  • Loading branch information
scrthq committed Apr 25, 2019
1 parent 9f5d630 commit f04e507
Show file tree
Hide file tree
Showing 15 changed files with 349 additions and 155 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,12 @@
* Fixed: `Start-GSDriveFileUpload` failing on PowerShell 4.0
* [Issue #179](https://github.com/scrthq/PSGSuite/issues/179)
* Added: `Ims` parameter to both `New-GSUser` and `Update-GSUser`
* Added: `Add-GSUserIM` function to create correct type for new `Ims` parameter.
* Added: `Add-GSUserIm` function to create correct type for new `Ims` parameter.
* Miscellaneous
* Added: `Clear-PSGSuiteServiceCache` to clear the cache and dispose of any remaining open web clients.
* Improved overall service caching.
* Added: Support for `Cloud-Identity` licenses for `Get-GSUserLicense`
* Added: `OutputType` for all applicable Helper functions (i.e. `Add-GSUserIm`)

## 2.26.1

Expand Down
29 changes: 15 additions & 14 deletions PSGSuite/Public/Helpers/Add-GSEventAttendee.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,44 @@ function Add-GSEventAttendee {
<#
.SYNOPSIS
Adds an event attendee to a calendar event
.DESCRIPTION
Adds an event attendee to a calendar event
.PARAMETER Email
The email address of the attendee
.PARAMETER AdditionalGuests
How many additional guests, if any
.PARAMETER Comment
Attendee comment
.PARAMETER DisplayName
The attendee's name, if available
.PARAMETER Optional
Whether this is an optional attendee
.PARAMETER Organizer
Whether the attendee is the organizer of the event
.PARAMETER Resource
Whether the attendee is a resource
.PARAMETER ResponseStatus
The attendee's response status.
Possible values are:
The attendee's response status.
Possible values are:
* "NeedsAction": The attendee has not responded to the invitation.
* "Declined": The attendee has declined the invitation.
* "Tentative": The attendee has tentatively accepted the invitation.
* "Accepted": The attendee has accepted the invitation
.PARAMETER InputObject
Used for pipeline input of an existing UserAddress object to strip the extra attributes and prevent errors
#>
[OutputType('Google.Apis.Calendar.v3.Data.EventAttendee')]
[CmdletBinding(DefaultParameterSetName = "InputObject")]
Param
(
Expand Down Expand Up @@ -114,4 +115,4 @@ function Add-GSEventAttendee {
}
}
}
}
}
1 change: 1 addition & 0 deletions PSGSuite/Public/Helpers/Add-GSGmailSmtpMsa.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function Add-GSGmailSmtpMsa {
Updates Joe's SendAs settings for his work SendAs alias, including signature and SmtpMsa settings.
#>
[OutputType('Google.Apis.Gmail.v1.Data.SmtpMsa')]
[CmdletBinding(DefaultParameterSetName = "InputObject")]
Param
(
Expand Down
3 changes: 2 additions & 1 deletion PSGSuite/Public/Helpers/Add-GSUserAddress.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function Add-GSUserAddress {
Creates a user named John Smith and adds their work address, work phone, login_id and alternate non gsuite work email to the user object.
#>
[OutputType('Google.Apis.Admin.Directory.directory_v1.Data.UserAddress')]
[CmdletBinding(DefaultParameterSetName = "InputObject")]
Param
(
Expand Down Expand Up @@ -163,4 +164,4 @@ function Add-GSUserAddress {
}
}
}
}
}
3 changes: 2 additions & 1 deletion PSGSuite/Public/Helpers/Add-GSUserEmail.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function Add-GSUserEmail {
Creates a user named John Smith and adds their work address, work phone, login_id and alternate non gsuite work email to the user object.
#>
[OutputType('Google.Apis.Admin.Directory.directory_v1.Data.UserEmail')]
[CmdletBinding()]
Param
(
Expand Down Expand Up @@ -97,4 +98,4 @@ function Add-GSUserEmail {
}
}
}
}
}
3 changes: 2 additions & 1 deletion PSGSuite/Public/Helpers/Add-GSUserExternalId.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function Add-GSUserExternalId {
Creates a user named John Smith and adds their work address, work phone, login_id and alternate non gsuite work email to the user object.
#>
[OutputType('Google.Apis.Admin.Directory.directory_v1.Data.UserExternalId')]
[CmdletBinding(DefaultParameterSetName = "InputObject")]
Param
(
Expand Down Expand Up @@ -94,4 +95,4 @@ function Add-GSUserExternalId {
}
}
}
}
}
134 changes: 134 additions & 0 deletions PSGSuite/Public/Helpers/Add-GSUserIm.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
function Add-GSUserIm {
<#
.SYNOPSIS
Builds an IM object to use when creating or updating a User
.DESCRIPTION
Builds an IM object to use when creating or updating a User
.PARAMETER CustomProtocol
If the protocol value is custom_protocol, this property holds the custom protocol's string.
.PARAMETER CustomType
If the value of type is custom, this property contains the custom type.
.PARAMETER Im
The user's IM network ID.
.PARAMETER Primary
If this is the user's primary IM. Only one entry in the IM list can have a value of true.
.PARAMETER Protocol
An IM protocol identifies the IM network. The value can be a custom network or the standard network.
Acceptable values are:
* "aim": AOL Instant Messenger protocol
* "custom_protocol": A custom IM network protocol
* "gtalk": Google Talk protocol
* "icq": ICQ protocol
* "jabber": Jabber protocol
* "msn": MSN Messenger protocol
* "net_meeting": Net Meeting protocol
* "qq": QQ protocol
* "skype": Skype protocol
* "yahoo": Yahoo Messenger protocol
"aim","custom_protocol","gtalk","icq","jabber","msn","net_meeting","qq","skype","yahoo"
.PARAMETER Type
The type of the IM account.
Acceptable values are:
* "custom"
* "home"
* "other"
* "work"
.PARAMETER InputObject
Used for pipeline input of an existing IM object to strip the extra attributes and prevent errors
.EXAMPLE
$address = Add-GSUserAddress -Country USA -Locality Dallas -PostalCode 75000 Region TX -StreetAddress '123 South St' -Type Work -Primary
$phone = Add-GSUserPhone -Type Work -Value "(800) 873-0923" -Primary
$extId = Add-GSUserExternalId -Type Login_Id -Value jsmith2
$email = Add-GSUserEmail -Type work -Address [email protected]
$im = Add-GSUserIm -Type work -Protocol custom_protocol -CustomProtocol spark -Im jsmithertons100
New-GSUser -PrimaryEmail [email protected] -GivenName John -FamilyName Smith -Password (ConvertTo-SecureString -String 'Password123' -AsPlainText -Force) -ChangePasswordAtNextLogin -OrgUnitPath "/Users/New Hires" -IncludeInGlobalAddressList -Addresses $address -Phones $phone -ExternalIds $extId -Emails $email -Ims $im
Creates a user named John Smith and adds their work address, work phone, IM, login_id and alternate non gsuite work email to the user object.
#>
[OutputType('Google.Apis.Admin.Directory.directory_v1.Data.UserIm')]
[CmdletBinding()]
Param
(
[Parameter(Mandatory = $false, ParameterSetName = "Fields")]
[String]
$CustomProtocol,
[Parameter(Mandatory = $false, ParameterSetName = "Fields")]
[String]
$CustomType,
[Parameter(Mandatory = $false, ParameterSetName = "Fields")]
[String]
$Im,
[Parameter(Mandatory = $false, ParameterSetName = "Fields")]
[Switch]
$Primary,
[Parameter(Mandatory = $false, ParameterSetName = "Fields")]
[ValidateSet("aim","custom_protocol","gtalk","icq","jabber","msn","net_meeting","qq","skype","yahoo")]
[String]
$Protocol,
[Parameter(Mandatory = $false, ParameterSetName = "Fields")]
[ValidateSet('custom', 'home', 'other', 'work')]
[String]
$Type,
[Parameter(Mandatory = $false, ValueFromPipeline = $true, ParameterSetName = "InputObject")]
[Google.Apis.Admin.Directory.directory_v1.Data.UserIm[]]
$InputObject
)
Begin {
$propsToWatch = @(
'CustomProtocol'
'CustomType'
'Im'
'Primary'
'Protocol'
'Type'
)
}
Process {
try {
switch ($PSCmdlet.ParameterSetName) {
Fields {
$obj = New-Object 'Google.Apis.Admin.Directory.directory_v1.Data.UserIm'
foreach ($prop in $PSBoundParameters.Keys | Where-Object {$obj.PSObject.Properties.Name -contains $_}) {
$obj.$prop = $PSBoundParameters[$prop]
}
$obj
}
InputObject {
foreach ($iObj in $InputObject) {
$obj = New-Object 'Google.Apis.Admin.Directory.directory_v1.Data.UserIm'
foreach ($prop in $iObj.PSObject.Properties.Name | Where-Object {$obj.PSObject.Properties.Name -contains $_ -and $propsToWatch -contains $_}) {
$obj.$prop = $iObj.$prop
}
$obj
}
}
}
}
catch {
if ($ErrorActionPreference -eq 'Stop') {
$PSCmdlet.ThrowTerminatingError($_)
}
else {
Write-Error $_
}
}
}
}
1 change: 1 addition & 0 deletions PSGSuite/Public/Helpers/Add-GSUserLocation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function Add-GSUserLocation {
Adds a custom user location.
#>
[OutputType('Google.Apis.Admin.Directory.directory_v1.Data.UserLocation')]
[CmdletBinding()]
Param
(
Expand Down
3 changes: 2 additions & 1 deletion PSGSuite/Public/Helpers/Add-GSUserOrganization.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function Add-GSUserOrganization {
Creates a user named John Smith and adds their work address, work phone, login_id and alternate non gsuite work email to the user object.
#>
[OutputType('Google.Apis.Admin.Directory.directory_v1.Data.UserOrganization')]
[CmdletBinding(DefaultParameterSetName = "InputObject")]
Param
(
Expand Down Expand Up @@ -125,4 +126,4 @@ function Add-GSUserOrganization {
}
}
}
}
}
3 changes: 2 additions & 1 deletion PSGSuite/Public/Helpers/Add-GSUserPhone.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function Add-GSUserPhone {
Creates a user named John Smith and adds their work address, work phone, login_id and alternate non gsuite work email to the user object.
#>
[OutputType('Google.Apis.Admin.Directory.directory_v1.Data.UserAddress')]
[CmdletBinding()]
Param
(
Expand Down Expand Up @@ -115,4 +116,4 @@ function Add-GSUserPhone {
}
}
}
}
}
1 change: 1 addition & 0 deletions PSGSuite/Public/Helpers/Add-GSUserRelation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function Add-GSUserRelation {
Creates a user named John Smith and adds their work address, work phone, login_id and alternate non gsuite work email to the user object.
#>
[OutputType('Google.Apis.Admin.Directory.directory_v1.Data.UserRelation')]
[CmdletBinding(DefaultParameterSetName = "InputObject")]
Param
(
Expand Down
19 changes: 10 additions & 9 deletions PSGSuite/Public/Helpers/Add-GSUserSchemaField.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ function Add-GSUserSchemaField {
<#
.SYNOPSIS
Builds a UserPhone object to use when creating or updating a Schema
.DESCRIPTION
Builds a UserPhone object to use when creating or updating a Schema
.PARAMETER FieldName
The name of the field
.PARAMETER FieldType
The type of the field.
Expand All @@ -21,24 +21,25 @@ function Add-GSUserSchemaField {
* "INT64": 64-bit integer values.
* "PHONE": Phone numbers.
* "STRING": String values.
.PARAMETER Indexed
Switch specifying whether the field is indexed or not. Default: true
.PARAMETER MultiValued
A switch specifying whether this is a multi-valued field or not. Default: false
.PARAMETER ReadAccessType
Parameter description
.PARAMETER InputObject
Parameter description
.EXAMPLE
New-GSUserSchema -SchemaName "SDK" -Fields (Add-GSUserSchemaField -FieldName "string" -FieldType STRING -ReadAccessType ADMINS_AND_SELF),(Add-GSUserSchemaField -FieldName "date" -FieldType DATE -ReadAccessType ADMINS_AND_SELF)
This command will create a schema named "SDK" with two fields, "string" and "date", readable by ADMINS_AND_SELF
#>
[OutputType('Google.Apis.Admin.Directory.directory_v1.Data.SchemaFieldSpec')]
[CmdletBinding(DefaultParameterSetName = "InputObject")]
Param
(
Expand Down Expand Up @@ -102,4 +103,4 @@ function Add-GSUserSchemaField {
}
}
}
}
}
Loading

0 comments on commit f04e507

Please sign in to comment.