Skip to content

Commit

Permalink
!deploy v2.29.0 with multiple fixes
Browse files Browse the repository at this point in the history
## 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
scrthq authored Jun 28, 2019
2 parents b8d1af5 + f982626 commit 928e3e1
Show file tree
Hide file tree
Showing 13 changed files with 272 additions and 160 deletions.
25 changes: 19 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* [PSGSuite - ChangeLog](#psgsuite---changelog)
* [PSGSuite - ChangeLog](#PSGSuite---ChangeLog)
* [2.29.0](#2290)
* [2.28.2](#2282)
* [2.28.1](#2281)
* [2.28.0](#2280)
Expand Down Expand Up @@ -80,16 +81,28 @@
* [2.0.2](#202)
* [2.0.1](#201)
* [2.0.0](#200)
* [New Functionality](#new-functionality)
* [Breaking Changes in 2.0.0](#breaking-changes-in-200)
* [Gmail Delegation Management Removed](#gmail-delegation-management-removed)
* [Functions Removed](#functions-removed)
* [Functions Aliased](#functions-aliased)
* [New Functionality](#New-Functionality)
* [Breaking Changes in 2.0.0](#Breaking-Changes-in-200)
* [Gmail Delegation Management Removed](#Gmail-Delegation-Management-Removed)
* [Functions Removed](#Functions-Removed)
* [Functions Aliased](#Functions-Aliased)

***

# PSGSuite - ChangeLog

## 2.29.0

* [Issue #201](https://github.com/scrthq/PSGSuite/issues/201)
* Fixed: Fields parameter on remaining `*-GSDriveFile` functions
* [Issue #197](https://github.com/scrthq/PSGSuite/issues/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](https://github.com/scrthq/PSGSuite/issues/184)
* Added: `EnableCollaborativeInbox` parameter to `Update-GSGroupSettings`
* Added: `WhoCanDiscoverGroup` parameter to `Update-GSGroupSettings`

## 2.28.2

* [Issue #194](https://github.com/scrthq/PSGSuite/issues/194)
Expand Down
4 changes: 4 additions & 0 deletions PSGSuite/Aliases/PSGSuite.Aliases.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Alias => => => => => => => => Function
@{
'Add-GSDriveFilePermissions' = 'Add-GSDrivePermission'
'Export-PSGSuiteConfiguration' = 'Set-PSGSuiteConfig'
Expand Down Expand Up @@ -33,10 +34,13 @@
'Import-PSGSuiteConfiguration' = 'Get-PSGSuiteConfig'
'Move-GSGmailMessageToTrash' = 'Remove-GSGmailMessage'
'New-GSCalendarResource' = 'New-GSResource'
'New-GSTeamDrive' = 'New-GSDrive'
'Remove-GSGmailMessageFromTrash' = 'Restore-GSGmailMessage'
'Remove-GSTeamDrive' = 'Remove-GSDrive'
'Set-PSGSuiteDefaultDomain' = 'Switch-PSGSuiteConfig'
'Switch-PSGSuiteDomain' = 'Switch-PSGSuiteConfig'
'Update-GSCalendarResource' = 'Update-GSResource'
'Update-GSGmailSendAsSettings' = 'Update-GSGmailSendAsAlias'
'Update-GSSheetValue' = 'Export-GSSheet'
'Update-GSTeamDrive' = 'Update-GSDrive'
}
2 changes: 1 addition & 1 deletion PSGSuite/PSGSuite.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'PSGSuite.psm1'

# Version number of this module.
ModuleVersion = '2.28.2'
ModuleVersion = '2.29.0'

# ID used to uniquely identify this module
GUID = '9d751152-e83e-40bb-a6db-4c329092aaec'
Expand Down
2 changes: 1 addition & 1 deletion PSGSuite/Public/Drive/Copy-GSDriveFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function Copy-GSDriveFile {
}
}
}
elseif ($Fields) {
elseif ($PSBoundParameters.ContainsKey('Fields')) {
$fs = $Fields
}
}
Expand Down
2 changes: 1 addition & 1 deletion PSGSuite/Public/Drive/Export-GSDriveFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function Export-GSDriveFile {
}
}
}
elseif ($Fields) {
elseif ($PSBoundParameters.ContainsKey('Fields')) {
$fs = $Fields
}
$mimeHash = @{
Expand Down
64 changes: 64 additions & 0 deletions PSGSuite/Public/Drive/Hide-GSDrive.ps1
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 $_
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
function New-GSTeamDrive {
function New-GSDrive {
<#
.SYNOPSIS
Creates a new Team Drive
Creates a new Shared Drive
.DESCRIPTION
Creates a new Team Drive
Creates a new Shared Drive
.PARAMETER Name
The name of the Team Drive
The name of the Shared Drive
.PARAMETER User
The user to create the Team Drive for (must have permissions to create Team Drives)
The user to create the Shared Drive for (must have permissions to create Shared Drives)
.PARAMETER RequestId
An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned.
An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Shared Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Shared Drive. If the Shared Drive already exists a 409 error will be returned.
.PARAMETER CanAddChildren
Whether the current user can add children to folders in this Team Drive
Whether the current user can add children to folders in this Shared Drive
.PARAMETER CanChangeTeamDriveBackground
Whether the current user can change the background of this Team Drive
.PARAMETER CanChangeDriveBackground
Whether the current user can change the background of this Shared Drive
.PARAMETER CanComment
Whether the current user can comment on files in this Team Drive
Whether the current user can comment on files in this Shared Drive
.PARAMETER CanCopy
Whether the current user can copy files in this Team Drive
Whether the current user can copy files in this Shared Drive
.PARAMETER CanDeleteTeamDrive
Whether the current user can delete this Team Drive. Attempting to delete the Team Drive may still fail if there are untrashed items inside the Team Drive
.PARAMETER CanDeleteDrive
Whether the current user can delete this Shared Drive. Attempting to delete the Shared Drive may still fail if there are untrashed items inside the Shared Drive
.PARAMETER CanDownload
Whether the current user can download files in this Team Drive
Whether the current user can download files in this Shared Drive
.PARAMETER CanEdit
Whether the current user can edit files in this Team Drive
Whether the current user can edit files in this Shared Drive
.PARAMETER CanListChildren
Whether the current user can list the children of folders in this Team Drive
Whether the current user can list the children of folders in this Shared Drive
.PARAMETER CanManageMembers
Whether the current user can add members to this Team Drive or remove them or change their role
Whether the current user can add members to this Shared Drive or remove them or change their role
.PARAMETER CanReadRevisions
Whether the current user can read the revisions resource of files in this Team Drive
Whether the current user can read the revisions resource of files in this Shared Drive
.PARAMETER CanRemoveChildren
Whether the current user can remove children from folders in this Team Drive
Whether the current user can remove children from folders in this Shared Drive
.PARAMETER CanRename
Whether the current user can rename files or folders in this Team Drive
Whether the current user can rename files or folders in this Shared Drive
.PARAMETER CanRenameTeamDrive
Whether the current user can rename this Team Drive
.PARAMETER CanRenameDrive
Whether the current user can rename this Shared Drive
.PARAMETER CanShare
Whether the current user can share files or folders in this Team Drive
Whether the current user can share files or folders in this Shared Drive
.EXAMPLE
New-GSTeamDrive -Name "Training Docs"
New-GSDrive -Name "Training Docs"
Creates a new Team Drive named "Training Docs"
Creates a new Shared Drive named "Training Docs"
#>
[OutputType('Google.Apis.Drive.v3.Data.TeamDrive')]
[OutputType('Google.Apis.Drive.v3.Data.Drive')]
[cmdletbinding()]
Param
(
Expand All @@ -81,17 +81,19 @@ function New-GSTeamDrive {
[Switch]
$CanAddChildren,
[parameter(Mandatory = $false)]
[Alias('CanChangeTeamDriveBackground')]
[Switch]
$CanChangeTeamDriveBackground,
$CanChangeDriveBackground,
[parameter(Mandatory = $false)]
[Switch]
$CanComment,
[parameter(Mandatory = $false)]
[Switch]
$CanCopy,
[parameter(Mandatory = $false)]
[Alias('CanDeleteTeamDrive')]
[Switch]
$CanDeleteTeamDrive,
$CanDeleteDrive,
[parameter(Mandatory = $false)]
[Switch]
$CanDownload,
Expand All @@ -114,8 +116,9 @@ function New-GSTeamDrive {
[Switch]
$CanRename,
[parameter(Mandatory = $false)]
[Alias('CanRenameTeamDrive')]
[Switch]
$CanRenameTeamDrive,
$CanRenameDrive,
[parameter(Mandatory = $false)]
[Switch]
$CanShare
Expand All @@ -134,8 +137,8 @@ function New-GSTeamDrive {
}
$service = New-GoogleService @serviceParams
try {
$body = New-Object 'Google.Apis.Drive.v3.Data.TeamDrive'
$capabilities = New-Object 'Google.Apis.Drive.v3.Data.TeamDrive+CapabilitiesData'
$body = New-Object 'Google.Apis.Drive.v3.Data.Drive'
$capabilities = New-Object 'Google.Apis.Drive.v3.Data.Drive+CapabilitiesData'
foreach ($key in $PSBoundParameters.Keys) {
switch ($key) {
Default {
Expand All @@ -149,8 +152,8 @@ function New-GSTeamDrive {
}
}
$body.Capabilities = $capabilities
$request = $service.Teamdrives.Create($body,$RequestId)
Write-Verbose "Creating Team Drive '$Name' for user '$User'"
$request = $service.Drives.Create($body,$RequestId)
Write-Verbose "Creating Shared Drive '$Name' for user '$User'"
$request.Execute() | Add-Member -MemberType NoteProperty -Name 'User' -Value $User -PassThru | Add-Member -MemberType NoteProperty -Name 'RequestId' -Value $RequestId -PassThru
}
catch {
Expand Down
2 changes: 1 addition & 1 deletion PSGSuite/Public/Drive/New-GSDriveFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function New-GSDriveFile {
}
}
}
elseif ($Fields) {
elseif ($PSBoundParameters.ContainsKey('Fields')) {
$fs = $Fields
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
function Remove-GSTeamDrive {
function Remove-GSDrive {
<#
.SYNOPSIS
Removes a Team Drive
Removes a Shared Drive
.DESCRIPTION
Removes a Team Drive
Removes a Shared Drive
.PARAMETER TeamDriveId
The Id of the Team Drive to remove
.PARAMETER DriveId
The Id of the Shared Drive to remove
.PARAMETER User
The email or unique Id of the user with permission to delete the Team Drive
The email or unique Id of the user with permission to delete the Shared Drive
Defaults to the AdminEmail user
.EXAMPLE
Remove-TeamDrive -TeamDriveId "0AJ8Xjq3FcdCKUk9PVA" -Confirm:$false
Remove-Drive -DriveId "0AJ8Xjq3FcdCKUk9PVA" -Confirm:$false
Removes the Team Drive '0AJ8Xjq3FcdCKUk9PVA', skipping confirmation
Removes the Shared Drive '0AJ8Xjq3FcdCKUk9PVA', skipping confirmation
#>
[cmdletbinding(SupportsShouldProcess=$true,ConfirmImpact="High")]
Param
(
[parameter(Mandatory = $true,ValueFromPipelineByPropertyName = $true)]
[Alias('Id')]
[Alias('Id','TeamDriveId')]
[String[]]
$TeamDriveId,
$DriveId,
[parameter(Mandatory = $false,Position = 0,ValueFromPipelineByPropertyName = $true)]
[Alias('Owner','PrimaryEmail','UserKey','Mail')]
[string]
Expand All @@ -45,12 +45,12 @@ function Remove-GSTeamDrive {
}
$service = New-GoogleService @serviceParams
try {
foreach ($id in $TeamDriveId) {
if ($PSCmdlet.ShouldProcess("Deleting Team Drive '$id' from user '$User'")) {
Write-Verbose "Deleting Team Drive '$id' from user '$User'"
$request = $service.Teamdrives.Delete($id)
foreach ($id in $DriveId) {
if ($PSCmdlet.ShouldProcess("Deleting Shared Drive '$id' from user '$User'")) {
Write-Verbose "Deleting Shared Drive '$id' from user '$User'"
$request = $service.Drives.Delete($id)
$request.Execute()
Write-Verbose "Team Drive '$id' successfully deleted from user '$User'"
Write-Verbose "Shared Drive '$id' successfully deleted from user '$User'"
}
}
}
Expand Down
Loading

0 comments on commit 928e3e1

Please sign in to comment.