-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## 2.35.0 - 2019-12-29 * [Issue #216](#216) - _Thank you, [@WJurecki](https://github.com/WJurecki)!_ * Added `Add-GSSheetValues` to use the native `Append()` method instead of `BatchUpdate()` to prevent needing to calculate the last row like you do with `Export-GSSheet`. Since the input for this method has additional options and the output differs from what `Export-GSSheet` outputs, this has been moved to a unique function to prevent introducing breaking changes to `Export-GSSheet`. * [Issue #221](#221) * Added: `Invoke-GSUserOffboarding` function to wrap common offboarding tasks for ease of access management automation. * [Issue #248](#248) * Fixed `Get-GSSheetInfo` so it no longer defaults `-IncludeGridData` to `$true` if not specified in `$PSBoundParameters`. * [Issue #249](#249) * Updated private function `Resolve-Email` with new `IsGroup` switch, then cleaned up all `*-GSGroup*` functions to use it so that Group ID's are respected based on RegEx match. * [Issue #252](#252) * Added: `Archived` parameter to `Update-GSUser` to enable setting of Archived User licenses. * Miscellaneous * Swapped instances of `Get-StoragePath` for `Get-ConfigurationPath` in `Import-SpecificConfiguration` and `Set-PSGSuiteConfig` to avoid alias related issues with PowerShell 4.0
- Loading branch information
Showing
26 changed files
with
563 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ function Get-GSGroupAlias { | |
.DESCRIPTION | ||
Gets the specified G SUite Group's aliases | ||
.PARAMETER Group | ||
.PARAMETER Identity | ||
The primary email or ID of the group who you are trying to get aliases for. You can exclude the '@domain.com' to insert the Domain in the config or use the special 'me' to indicate the AdminEmail in the config. | ||
.EXAMPLE | ||
Get-GSGroupAlias -Group hr | ||
Get-GSGroupAlias -Identity hr | ||
Gets the list of aliases for the group [email protected] | ||
#> | ||
|
@@ -19,10 +19,9 @@ function Get-GSGroupAlias { | |
Param | ||
( | ||
[parameter(Mandatory = $true,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)] | ||
[Alias("Email")] | ||
[ValidateNotNullOrEmpty()] | ||
[Alias('GroupEmail','Group','Email')] | ||
[String[]] | ||
$Group | ||
$Identity | ||
) | ||
Begin { | ||
$serviceParams = @{ | ||
|
@@ -32,11 +31,9 @@ function Get-GSGroupAlias { | |
$service = New-GoogleService @serviceParams | ||
} | ||
Process { | ||
foreach ($G in $Group) { | ||
foreach ($G in $Identity) { | ||
try { | ||
if ($G -notlike "*@*.*") { | ||
$G = "$($G)@$($Script:PSGSuite.Domain)" | ||
} | ||
Resolve-Email ([ref]$G) -IsGroup | ||
Write-Verbose "Getting Alias list for Group '$G'" | ||
$request = $service.Groups.Aliases.List($G) | ||
$request.Execute() | Select-Object -ExpandProperty AliasesValue | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,26 +6,24 @@ function New-GSGroupAlias { | |
.DESCRIPTION | ||
Creates a new alias for a G Suite group | ||
.PARAMETER Group | ||
.PARAMETER Identity | ||
The group to create the alias for | ||
.PARAMETER Alias | ||
The alias or list of aliases to create for the group | ||
.EXAMPLE | ||
New-GSGroupAlias -Group [email protected] -Alias '[email protected]','[email protected]' | ||
New-GSGroupAlias -Identity [email protected] -Alias '[email protected]','[email protected]' | ||
Creates 2 new aliases for group Human Resources as '[email protected]' and '[email protected]' | ||
#> | ||
[OutputType('Google.Apis.Admin.Directory.directory_v1.Data.Alias')] | ||
[cmdletbinding()] | ||
Param | ||
( | ||
Param ( | ||
[parameter(Mandatory = $true,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)] | ||
[Alias("Email")] | ||
[ValidateNotNullOrEmpty()] | ||
[Alias('GroupEmail','Group','Email')] | ||
[String] | ||
$Group, | ||
$Identity, | ||
[parameter(Mandatory = $true,Position = 1)] | ||
[String[]] | ||
$Alias | ||
|
@@ -38,18 +36,14 @@ function New-GSGroupAlias { | |
$service = New-GoogleService @serviceParams | ||
} | ||
Process { | ||
Resolve-Email ([ref]$Identity) -IsGroup | ||
foreach ($A in $Alias) { | ||
try { | ||
if ($Group -notlike "*@*.*") { | ||
$Group = "$($Group)@$($Script:PSGSuite.Domain)" | ||
} | ||
if ($A -notlike "*@*.*") { | ||
$A = "$($A)@$($Script:PSGSuite.Domain)" | ||
} | ||
Write-Verbose "Creating alias '$A' for Group '$Group'" | ||
Resolve-Email ([ref]$A) | ||
Write-Verbose "Creating alias '$A' for Group '$Identity'" | ||
$body = New-Object 'Google.Apis.Admin.Directory.directory_v1.Data.Alias' | ||
$body.AliasValue = $A | ||
$request = $service.Groups.Aliases.Insert($body,$Group) | ||
$request = $service.Groups.Aliases.Insert($body,$Identity) | ||
$request.Execute() | ||
} | ||
catch { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,21 +2,20 @@ | |
<# | ||
.SYNOPSIS | ||
Removes a group | ||
.DESCRIPTION | ||
Removes a group | ||
.PARAMETER Identity | ||
The email or unique Id of the group to removed | ||
.EXAMPLE | ||
Remove-GSGroup 'test_group' -Confirm:$false | ||
Removes the group '[email protected]' without asking for confirmation | ||
#> | ||
[cmdletbinding(SupportsShouldProcess = $true,ConfirmImpact = "High")] | ||
Param | ||
( | ||
Param ( | ||
[parameter(Mandatory = $true,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)] | ||
[Alias('GroupEmail','Group','Email')] | ||
[String[]] | ||
|
@@ -32,9 +31,7 @@ | |
Process { | ||
try { | ||
foreach ($G in $Identity) { | ||
if ($G -notlike "*@*.*") { | ||
$G = "$($G)@$($Script:PSGSuite.Domain)" | ||
} | ||
Resolve-Email ([ref]$G) -IsGroup | ||
if ($PSCmdlet.ShouldProcess("Removing group '$G'")) { | ||
Write-Verbose "Removing group '$G'" | ||
$request = $service.Groups.Delete($G) | ||
|
@@ -52,4 +49,4 @@ | |
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.