-
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.
Browse files
Browse the repository at this point in the history
## 2.27.0 * [Issue #185](#185) * Fixed: `Get-GSGroup -Where_IsAMember $member` no longer errors. * [Issue #186](#186) * Added: `Test-GSGroupMembership` to map to the [hasMember method](https://developers.google.com/admin-sdk/directory/v1/reference/members/hasMember). * Miscellaneous * Improved build process to auto-update NuGet dependencies. * Added new private function `Resolve-Email` to convert a name-part or the case-sensitive `me` to the full email address accordingly.
- Loading branch information
Showing
69 changed files
with
868 additions
and
115 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
function Resolve-Email { | ||
[CmdletBinding()] | ||
Param ( | ||
[parameter(Mandatory,Position = 0,ValueFromPipeline,ValueFromPipelineByPropertyName)] | ||
[Ref[]] | ||
) | ||
Process { | ||
foreach ($e in $Email) { | ||
if ( -not ($e.value -as [decimal])) { | ||
if ($e.value -ceq 'me') { | ||
$e.value = $Script:PSGSuite.AdminEmail | ||
} | ||
elseif ($e.value -notlike "*@*.*") { | ||
$e.value = "$($e.value)@$($Script:PSGSuite.Domain)" | ||
} | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
function Test-GSGroupMembership { | ||
<# | ||
.SYNOPSIS | ||
Checks if a Group has a specific member | ||
.DESCRIPTION | ||
Checks if a Group has a specific member | ||
.PARAMETER Identity | ||
The email of the group | ||
If only the email name-part is passed, the full email will be contstructed using the Domain from the active config | ||
.PARAMETER Member | ||
The user to confirm as a member of the Group | ||
.EXAMPLE | ||
Test-GSGroupMembership -Identity [email protected] -Member [email protected] | ||
Gets the group settings for [email protected] | ||
#> | ||
[OutputType('Google.Apis.Admin.Directory.directory_v1.Data.MembersHasMember')] | ||
[cmdletbinding()] | ||
Param | ||
( | ||
[parameter(Mandatory = $true,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)] | ||
[Alias('GroupEmail','Group','Email')] | ||
[String] | ||
$Identity, | ||
[parameter(Mandatory = $true,ValueFromPipelineByPropertyName = $true,Position = 1)] | ||
[Alias("PrimaryEmail","UserKey","Mail","User","UserEmail","Members")] | ||
[ValidateNotNullOrEmpty()] | ||
[String] | ||
$Member | ||
) | ||
Begin { | ||
$serviceParams = @{ | ||
Scope = 'https://www.googleapis.com/auth/admin.directory.group' | ||
ServiceType = 'Google.Apis.Admin.Directory.directory_v1.DirectoryService' | ||
} | ||
$service = New-GoogleService @serviceParams | ||
} | ||
Process { | ||
try { | ||
Resolve-Email ([ref]$Identity),([ref]$Member) | ||
Write-Verbose "Checking if group '$Identity' has member '$Member'" | ||
$request = $service.Members.HasMember($Identity,$Member) | ||
$request.Execute() | Add-Member -MemberType NoteProperty -Name 'Group' -Value $Identity -Force -PassThru | Add-Member -MemberType NoteProperty -Name 'Member' -Value $Member -Force -PassThru | ||
} | ||
catch { | ||
if ($ErrorActionPreference -eq 'Stop') { | ||
$PSCmdlet.ThrowTerminatingError($_) | ||
} | ||
else { | ||
Write-Error $_ | ||
} | ||
} | ||
} | ||
} |
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
Binary file not shown.
Binary file removed
BIN
-21 KB
PSGSuite/lib/net45/Google.Apis.Admin.DataTransfer.datatransfer_v1.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-21 KB
PSGSuite/lib/netstandard1.3/Google.Apis.Admin.DataTransfer.datatransfer_v1.dll
Binary file not shown.
Binary file removed
BIN
-202 KB
PSGSuite/lib/netstandard1.3/Google.Apis.Admin.Directory.directory_v1.dll
Binary file not shown.
Binary file removed
BIN
-36.5 KB
PSGSuite/lib/netstandard1.3/Google.Apis.Admin.Reports.reports_v1.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Oops, something went wrong.