-
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
…103 ## 2.17.0 * [Issue #102](#102) * Fixed: `$EncryptionKey` PSM1 parameter now stores the AES key correctly so SecureStrings are encrypted/decrypted as intended. * [Issue #103](#103) * Updated: `SendNotificationEmail` parameter on `Add-GSDrivePermission` defaults to false for all User & Group permissions that are not ownership transfers. * Updated: Documentation for `SendNotificationEmail` parameter on `Add-GSDrivePermission` for clarity towards default Google API parameter values. * Added: More unit testing for `Get-GSUser` * Updated: `psake` build script
- Loading branch information
Showing
21 changed files
with
305 additions
and
183 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
TestPad.ps1 | ||
**TestPad.ps1 | ||
**-PSGSuite.xml | ||
**.insyncdl | ||
.vscode | ||
|
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 |
---|---|---|
@@ -1,18 +1,13 @@ | ||
Param | ||
( | ||
[parameter(Position = 0)] | ||
[System.Byte[]] | ||
$EncryptionKey = $(if (Get-Command Import-SCRTKey -ErrorAction SilentlyContinue) { | ||
Import-SCRTKey | ||
} | ||
else { | ||
$null | ||
}), | ||
[parameter(Position = 0,ValueFromRemainingArguments = $true)] | ||
[AllowNull()] | ||
[Byte[]] | ||
$EncryptionKey = $null, | ||
[parameter(Position = 1)] | ||
[string] | ||
$ConfigName = $null | ||
[AllowNull()] | ||
[String] | ||
$ConfigName | ||
) | ||
#Get public and private function definition files. | ||
$Public = @(Get-ChildItem -Recurse -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue) | ||
$Private = @(Get-ChildItem -Recurse -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue) | ||
$ModuleRoot = $PSScriptRoot | ||
New-Variable -Name PSGSuiteKey -Value $EncryptionKey -Scope Global -Force -PassThru |
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 |
---|---|---|
@@ -0,0 +1,89 @@ | ||
Mock 'New-GoogleService' -ModuleName PSGSuite -ParameterFilter {$ServiceType -eq 'Google.Apis.Admin.Directory.directory_v1.DirectoryService'} -MockWith { | ||
Write-Verbose "Mocking New-GoogleService for ServiceType '$ServiceType'" | ||
$o = New-Object PSObject -Property @{Users = [PSCustomObject]@{};ApplicationName = ""} | ||
$o.Users | Add-Member -Force -MemberType ScriptMethod -Name List -Value { | ||
New-Object -TypeName PSObject -Property @{ | ||
Projection = "" | ||
Domain = "" | ||
Customer = "" | ||
MaxResults = "" | ||
OrderBy = "" | ||
SortOrder = "" | ||
CustomFieldMask = "" | ||
ShowDeleted = $false | ||
ViewType = "" | ||
Query = "" | ||
PageToken = "" | ||
} | Add-Member -MemberType ScriptMethod -Name Execute -Value { | ||
$userList = @() | ||
1..2 | ForEach-Object { | ||
$userList += New-Object 'Google.Apis.Admin.Directory.directory_v1.Data.User' -Property @{ | ||
PrimaryEmail = "user$($_)@domain.com" | ||
OrgUnitPath = "/Users/$_" | ||
} | ||
foreach ($sub in (1..2)) { | ||
$userList += New-Object 'Google.Apis.Admin.Directory.directory_v1.Data.User' -Property @{ | ||
PrimaryEmail = "user$($_).$($sub)@domain.com" | ||
OrgUnitPath = "/Users/$_/$sub" | ||
} | ||
} | ||
} | ||
$userList += New-Object 'Google.Apis.Admin.Directory.directory_v1.Data.User' -Property @{ | ||
PrimaryEmail = "admin@domain.com" | ||
OrgUnitPath = "/Users" | ||
} | ||
if ( -not [String]::IsNullOrEmpty($this.Query)) { | ||
$filter = $this.Query.Trim() | ||
$left = $filter.Split('=',2)[1].Trim() | ||
$right = $filter.Split('=',2)[2].Trim("'") | ||
$filtered = $userList | Where-Object {$_.$left -like "$right*"} | ||
return ([PSCustomObject]@{ | ||
UsersValue = $filtered | ||
}) | ||
} | ||
else { | ||
return ([PSCustomObject]@{ | ||
UsersValue = $userList | ||
}) | ||
} | ||
} -Force -PassThru | ||
} | ||
$o.Users | Add-Member -Force -MemberType ScriptMethod -Name Get -Value { | ||
Process { | ||
$UserKey = $args[0] | ||
New-Object -TypeName PSObject -Property @{ | ||
Projection = "" | ||
Domain = "" | ||
Customer = "" | ||
MaxResults = "" | ||
OrderBy = "" | ||
SortOrder = "" | ||
CustomFieldMask = "" | ||
ViewType = "" | ||
Fields = "" | ||
UserKey = $UserKey | ||
} | Add-Member -MemberType ScriptMethod -Name Execute -Value { | ||
$userList = @() | ||
1..2 | ForEach-Object { | ||
$userList += New-Object 'Google.Apis.Admin.Directory.directory_v1.Data.User' -Property @{ | ||
PrimaryEmail = "user$($_)@domain.com" | ||
OrgUnitPath = "/Users/$_" | ||
} | ||
foreach ($sub in (1..2)) { | ||
$userList += New-Object 'Google.Apis.Admin.Directory.directory_v1.Data.User' -Property @{ | ||
PrimaryEmail = "user$($_).$($sub)@domain.com" | ||
OrgUnitPath = "/Users/$_/$sub" | ||
} | ||
} | ||
} | ||
if ($userFound = $userList | Where-Object {$_.PrimaryEmail -eq $this.UserKey}) { | ||
return $userFound | ||
} | ||
else { | ||
Write-Error "User not found!" | ||
} | ||
} -Force -PassThru | ||
} | ||
} | ||
return $o | ||
} |
Oops, something went wrong.