-
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.31.1 - 2019-08-30 * [Issue #222](#222) * Fixed: `Remove-GSUserASP` and `Remove-GSUserToken` not removing all when no Id is passed due to no service being created. * [Issue #225](#225) * Added: `RecoveryEmail` and `RecoveryPhone` parameters to `Update-GSUser` * [Issue #189](#189) * Removed `$env:UserName` from the application name when creating the client in `New-GoogleService` to prevent errors with the underlying .NET SDK. * Miscellaneous * Fixed: Corrected logic on the `FullName` parameter on `Update-GSUser` to parse the name parts. * Updated Google .NET SDKs to latest versions.
- Loading branch information
Showing
9 changed files
with
126 additions
and
79 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,12 @@ function Update-GSUser { | |
To CLEAR all values for a user, pass `$null` as the value for this parameter. | ||
.PARAMETER RecoveryEmail | ||
Recovery email of the user. | ||
.PARAMETER RecoveryPhone | ||
Recovery phone of the user. The phone number must be in the E.164 format, starting with the plus sign (+). Example: +16506661212. The value provided for RecoveryPhone is stripped of all non-digit characters and prepended with a + to ensure correct formatting. | ||
.PARAMETER Relations | ||
A list of the user's relationships to other users. | ||
|
@@ -129,7 +135,7 @@ function Update-GSUser { | |
Updates user [email protected] with a new primary email of "[email protected]", sets their Given Name to "Johnathan" and unsuspends them. Their previous primary email "[email protected]" will become an alias on their account automatically | ||
#> | ||
[OutputType('Google.Apis.Admin.Directory.directory_v1.Data.User')] | ||
[cmdletbinding(SupportsShouldProcess = $true, ConfirmImpact = "High")] | ||
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "High",DefaultParameterSetName = "NamePart")] | ||
Param | ||
( | ||
[parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] | ||
|
@@ -140,13 +146,13 @@ function Update-GSUser { | |
[parameter(Mandatory = $false)] | ||
[String] | ||
$PrimaryEmail, | ||
[parameter(Mandatory = $false)] | ||
[parameter(Mandatory = $false,ParameterSetName = "NamePart")] | ||
[String] | ||
$GivenName, | ||
[parameter(Mandatory = $false)] | ||
[parameter(Mandatory = $false,ParameterSetName = "NamePart")] | ||
[String] | ||
$FamilyName, | ||
[parameter(Mandatory = $false)] | ||
[parameter(Mandatory = $false,ParameterSetName = "FullName")] | ||
[String] | ||
$FullName, | ||
[parameter(Mandatory = $false)] | ||
|
@@ -183,6 +189,12 @@ function Update-GSUser { | |
[Google.Apis.Admin.Directory.directory_v1.Data.UserRelation[]] | ||
$Relations, | ||
[parameter(Mandatory = $false)] | ||
[String] | ||
$RecoveryEmail, | ||
[parameter(Mandatory = $false)] | ||
[String] | ||
$RecoveryPhone, | ||
[parameter(Mandatory = $false)] | ||
[Google.Apis.Admin.Directory.directory_v1.Data.UserPhone[]] | ||
$Phones, | ||
[parameter(Mandatory = $false)] | ||
|
@@ -246,7 +258,17 @@ function Update-GSUser { | |
$nameUpdated = $true | ||
} | ||
FullName { | ||
$name.$prop = $PSBoundParameters[$prop] | ||
$fName = $PSBoundParameters[$prop] | ||
if ($fName -match ',') { | ||
$splitName = ($fName -split ',',2).Trim() | ||
$name.FamilyName = $splitName[0] | ||
$name.GivenName = $splitName[1] | ||
} | ||
else { | ||
$splitName = ($fName -split ' ').Trim() | ||
$name.FamilyName = $splitName[-1] | ||
$name.GivenName = $splitName[0..$($splitName.Count - 2)] -join " " | ||
} | ||
$nameUpdated = $true | ||
} | ||
Password { | ||
|
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