-
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.29.0 * [Issue #201](#201) * Fixed: Fields parameter on remaining `*-GSDriveFile` functions * [Issue #197](#197) * Updated: All remaining `*-TeamDrive` functions now use the new Drives namespace. All previous functions names have been converted to aliases to maintain backwards compatibility. * Added: `Hide-GSDrive` * Added: `Show-GSDrive` * [Issue #184](#184) * Added: `EnableCollaborativeInbox` parameter to `Update-GSGroupSettings` * Added: `WhoCanDiscoverGroup` parameter to `Update-GSGroupSettings`
- Loading branch information
Showing
13 changed files
with
272 additions
and
160 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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
function Hide-GSDrive { | ||
<# | ||
.SYNOPSIS | ||
Hides a Shared Drive from the default view | ||
.DESCRIPTION | ||
Hides a Shared Drive from the default view | ||
.PARAMETER DriveId | ||
The unique Id of the Shared Drive to hide | ||
.PARAMETER User | ||
The email or unique Id of the user who you'd like to hide the Shared Drive for. | ||
Defaults to the AdminEmail user. | ||
.EXAMPLE | ||
Hide-GSDrive -DriveId $driveIds | ||
Hides the specified DriveIds for the AdminEmail user | ||
#> | ||
[OutputType('Google.Apis.Drive.v3.Data.Drive')] | ||
[cmdletbinding()] | ||
Param | ||
( | ||
[parameter(Mandatory = $true,ValueFromPipelineByPropertyName = $true,ParameterSetName = "Get")] | ||
[Alias('Id','TeamDriveId')] | ||
[String[]] | ||
$DriveId, | ||
[parameter(Mandatory = $false,Position = 0,ValueFromPipelineByPropertyName = $true)] | ||
[Alias('Owner','PrimaryEmail','UserKey','Mail')] | ||
[string] | ||
$User = $Script:PSGSuite.AdminEmail | ||
) | ||
Process { | ||
if ($User -ceq 'me') { | ||
$User = $Script:PSGSuite.AdminEmail | ||
} | ||
elseif ($User -notlike "*@*.*") { | ||
$User = "$($User)@$($Script:PSGSuite.Domain)" | ||
} | ||
$serviceParams = @{ | ||
Scope = 'https://www.googleapis.com/auth/drive' | ||
ServiceType = 'Google.Apis.Drive.v3.DriveService' | ||
User = $User | ||
} | ||
$service = New-GoogleService @serviceParams | ||
foreach ($id in $DriveId) { | ||
try { | ||
$request = $service.Drives.Hide($id) | ||
Write-Verbose "Hiding Shared Drive '$id' for user '$User'" | ||
$request.Execute() | Add-Member -MemberType NoteProperty -Name 'User' -Value $User -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
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.