Skip to content

Commit

Permalink
!deploy v2.28.0 - Fixes/features for #188, #190, #192, #194, #195, #196
Browse files Browse the repository at this point in the history
…, #197 (#198)

## 2.28.0

* [Issue #188](#188)
  * Added: `Get-GSDriveFile` now supports specifying a full file path.
  * Fixed: `Get-GSDriveFile` will now replace any special path characters in the filename with underscores
  * Added: The File object returned by `Get-GSDriveFile` will now include an additional `OutFilePath` property if the file is downloaded. This property will contain the full path to the downloaded file.
* [Issue #190](#190)
  * Fixed: `Fields` parameter on `Get-GSDriveFile` and `Update-GSDriveFile` were not being honored.
* [Issue #192](#192)
  * Added: Parameters to `Update-GSDriveFile`:
    * `CopyRequiresWriterPermission [switch]`
    * `Starred [switch]`
    * `Trashed [switch]`
    * `WritersCanShare [switch]`
* [Issue #194](#194)
  * Added: Parameters to `Update-GSChromeOSDevice`:
    * `AnnotatedAssetId [string]`
    * `AnnotatedLocation [string]`
    * `AnnotatedUser [string]`
    * `Notes [string]`
* [Issue #195](#195)
  * Added: `Limit` parameter with `First` alias to the following `List` functions:
    * `Get-GSActivityReport`
    * `Get-GSAdminRole`
    * `Get-GSAdminRoleAssignment`
    * `Get-GSCalendar`
    * `Get-GSCalendarAcl`
    * `Get-GSCalendarEvent`
    * `Get-GSChromeOSDevice`
    * `Get-GSDataTransferApplication`
    * `Get-GSDrive`
    * `Get-GSDriveFileList`
    * `Get-GSDrivePermission`
    * `Get-GSGmailMessageList`
    * `Get-GSGroup`
    * `Get-GSGroupMember`
    * `Get-GSMobileDevice`
    * `Get-GSResource`
    * `Get-GSTask`
    * `Get-GSTaskList`
    * `Get-GSUsageReport`
    * `Get-GSUser`
    * `Get-GSUserLicense`
* [Issue #196](#196)
  * Fixed: `Get-GSTeamDrive` was not paginating through the results.
* [Issue #197](#197)
  * Renamed: `Get-GSTeamDrive` has been changed to `Get-GSDrive`. `Get-GSTeamDrive` has been turned into an alias for `Get-GSDrive` to maintain backwards compatibility.
  * Replaced: `SupportsTeamDrives = $true` with `SupportsAllDrives = $true` on all functions that have it.
* Miscellaneous
  * Fixed: `Export-PSGSuiteConfig` is faster due to safely assuming that the P12Key and/or ClientSecrets values have already been pulled from the corresponding keys.
  * Fixed: Incomplete documentation for `Test-GSGroupMembership`.
  * Added: `UseDomainAdminAccess` switch parameter to `Get-GSTeamDrive`
  * Removed: `Get-GSUserLicenseListPrivate` by rolling the `List` code into `Get-GSUserLicense`
  * Removed: `Get-GSResourceListPrivate` by rolling the `List` code into `Get-GSResource`
  • Loading branch information
scrthq authored May 31, 2019
2 parents 155a4b1 + 1c69af4 commit b3bfcf5
Show file tree
Hide file tree
Showing 45 changed files with 1,244 additions and 596 deletions.
62 changes: 59 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Changelog

* [Changelog](#changelog)
* [PSGSuite - ChangeLog](#psgsuite---changelog)
* [2.28.0](#2280)
* [2.27.0](#2270)
* [2.26.4](#2264)
* [2.26.3](#2263)
Expand Down Expand Up @@ -87,6 +86,63 @@

***

# PSGSuite - ChangeLog

## 2.28.0

* [Issue #188](https://github.com/scrthq/PSGSuite/issues/188)
* Added: `Get-GSDriveFile` now supports specifying a full file path.
* Fixed: `Get-GSDriveFile` will now replace any special path characters in the filename with underscores
* Added: The File object returned by `Get-GSDriveFile` will now include an additional `OutFilePath` property if the file is downloaded. This property will contain the full path to the downloaded file.
* [Issue #190](https://github.com/scrthq/PSGSuite/issues/190)
* Fixed: `Fields` parameter on `Get-GSDriveFile` and `Update-GSDriveFile` were not being honored.
* [Issue #192](https://github.com/scrthq/PSGSuite/issues/192)
* Added: Parameters to `Update-GSDriveFile`:
* `CopyRequiresWriterPermission [switch]`
* `Starred [switch]`
* `Trashed [switch]`
* `WritersCanShare [switch]`
* [Issue #194](https://github.com/scrthq/PSGSuite/issues/194)
* Added: Parameters to `Update-GSChromeOSDevice`:
* `AnnotatedAssetId [string]`
* `AnnotatedLocation [string]`
* `AnnotatedUser [string]`
* `Notes [string]`
* [Issue #195](https://github.com/scrthq/PSGSuite/issues/195)
* Added: `Limit` parameter with `First` alias to the following `List` functions:
* `Get-GSActivityReport`
* `Get-GSAdminRole`
* `Get-GSAdminRoleAssignment`
* `Get-GSCalendar`
* `Get-GSCalendarAcl`
* `Get-GSCalendarEvent`
* `Get-GSChromeOSDevice`
* `Get-GSDataTransferApplication`
* `Get-GSDrive`
* `Get-GSDriveFileList`
* `Get-GSDrivePermission`
* `Get-GSGmailMessageList`
* `Get-GSGroup`
* `Get-GSGroupMember`
* `Get-GSMobileDevice`
* `Get-GSResource`
* `Get-GSTask`
* `Get-GSTaskList`
* `Get-GSUsageReport`
* `Get-GSUser`
* `Get-GSUserLicense`
* [Issue #196](https://github.com/scrthq/PSGSuite/issues/196)
* Fixed: `Get-GSTeamDrive` was not paginating through the results.
* [Issue #197](https://github.com/scrthq/PSGSuite/issues/197)
* Renamed: `Get-GSTeamDrive` has been changed to `Get-GSDrive`. `Get-GSTeamDrive` has been turned into an alias for `Get-GSDrive` to maintain backwards compatibility.
* Replaced: `SupportsTeamDrives = $true` with `SupportsAllDrives = $true` on all functions that have it.
* Miscellaneous
* Fixed: `Export-PSGSuiteConfig` is faster due to safely assuming that the P12Key and/or ClientSecrets values have already been pulled from the corresponding keys.
* Fixed: Incomplete documentation for `Test-GSGroupMembership`.
* Added: `UseDomainAdminAccess` switch parameter to `Get-GSTeamDrive`
* Removed: `Get-GSUserLicenseListPrivate` by rolling the `List` code into `Get-GSUserLicense`
* Removed: `Get-GSResourceListPrivate` by rolling the `List` code into `Get-GSResource`

## 2.27.0

* [Issue #185](https://github.com/scrthq/PSGSuite/issues/185)
Expand Down
11 changes: 6 additions & 5 deletions PSGSuite/Aliases/PSGSuite.Aliases.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
@{
'Add-GSDriveFilePermissions' = 'Add-GSDrivePermission'
'Export-PSGSuiteConfiguration' = 'Set-PSGSuiteConfig'
'Get-GSCalendarResourceList' = 'Get-GSResourceList'
'Get-GSCalendarEventList' = 'Get-GSCalendarEvent'
'Get-GSCalendarResourceList' = 'Get-GSResourceList'
'Get-GSDataTransferApplicationList' = 'Get-GSDataTransferApplication'
'Get-GSDriveFileInfo' = 'Get-GSDriveFile'
'Get-GSDriveFilePermissionsList' = 'Get-GSDrivePermission'
'Get-GSGmailDelegates' = 'Get-GSGmailDelegate'
'Get-GSGmailFilterList' = 'Get-GSGmailFilter'
'Get-GSGmailLabelList' = 'Get-GSGmailLabel'
'Get-GSGmailMessageInfo' = 'Get-GSGmailMessage'
'Get-GSGmailSendAsSettings' = 'Get-GSGmailSendAsAlias'
'Get-GSGmailSignature' = 'Get-GSGmailSendAsAlias'
'Get-GSGroupList' = 'Get-GSGroup'
'Get-GSGroupMemberList' = 'Get-GSGroupMember'
'Get-GSMobileDeviceList' = 'Get-GSMobileDevice'
Expand All @@ -19,7 +21,8 @@
'Get-GSOU' = 'Get-GSOrganizationalUnit'
'Get-GSResourceList' = 'Get-GSResource'
'Get-GSShortURLInfo' = 'Get-GSShortURL'
'Get-GSTeamDrivesList' = 'Get-GSTeamDrive'
'Get-GSTeamDrive' = 'Get-GSDrive'
'Get-GSTeamDrivesList' = 'Get-GSDrive'
'Get-GSUserASPList' = 'Get-GSUserASP'
'Get-GSUserLicenseInfo' = 'Get-GSUserLicense'
'Get-GSUserLicenseList' = 'Get-GSUserLicense'
Expand All @@ -34,8 +37,6 @@
'Set-PSGSuiteDefaultDomain' = 'Switch-PSGSuiteConfig'
'Switch-PSGSuiteDomain' = 'Switch-PSGSuiteConfig'
'Update-GSCalendarResource' = 'Update-GSResource'
'Update-GSSheetValue' = 'Export-GSSheet'
'Get-GSGmailSignature' = 'Get-GSGmailSendAsAlias'
'Get-GSGmailSendAsSettings' = 'Get-GSGmailSendAsAlias'
'Update-GSGmailSendAsSettings' = 'Update-GSGmailSendAsAlias'
'Update-GSSheetValue' = 'Export-GSSheet'
}
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.27.0'
ModuleVersion = '2.28.0'

# ID used to uniquely identify this module
GUID = '9d751152-e83e-40bb-a6db-4c329092aaec'
Expand Down
11 changes: 11 additions & 0 deletions PSGSuite/Private/Get-SafeFileName.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function Get-SafeFileName {
[CmdletBinding()]
Param (
[parameter(Mandatory,ValueFromPipeline,Position = 0)]
[String]
$Name
)
Process {
$Name -replace "[$(([System.IO.Path]::GetInvalidFileNameChars() + [System.IO.Path]::GetInvalidPathChars()) -join '')]","_"
}
}
116 changes: 0 additions & 116 deletions PSGSuite/Private/ListPrivate/Get-GSUserLicenseListPrivate.ps1

This file was deleted.

25 changes: 22 additions & 3 deletions PSGSuite/Public/Calendar/Get-GSCalendar.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ function Get-GSCalendar {
.PARAMETER PageSize
Maximum number of entries returned on one result page. The page size can never be larger than 250 entries.
.PARAMETER Limit
The maximum amount of results you want returned. Exclude or set to 0 to return all results
.PARAMETER ShowDeleted
Whether to include deleted calendar list entries in the result. Optional. The default is False.
Expand Down Expand Up @@ -58,6 +61,10 @@ function Get-GSCalendar {
[Int]
$PageSize = 250,
[parameter(Mandatory = $false,ParameterSetName = "List")]
[Alias('First')]
[Int]
$Limit = 0,
[parameter(Mandatory = $false,ParameterSetName = "List")]
[switch]
$ShowDeleted,
[parameter(Mandatory = $false,ParameterSetName = "List")]
Expand Down Expand Up @@ -107,11 +114,14 @@ function Get-GSCalendar {
$request.$key = $PSBoundParameters[$key]
}
}
if ($PageSize) {
$request.MaxResults = $PageSize
if ($Limit -gt 0 -and $PageSize -gt $Limit) {
Write-Verbose ("Reducing PageSize from {0} to {1} to meet limit with first page" -f $PageSize,$Limit)
$PageSize = $Limit
}
$request.MaxResults = $PageSize
Write-Verbose "Getting Calendar List for user '$U'"
[int]$i = 1
$overLimit = $false
do {
$result = $request.Execute()
$result.Items | Add-Member -MemberType NoteProperty -Name 'User' -Value $U -PassThru
Expand All @@ -120,9 +130,18 @@ function Get-GSCalendar {
}
[int]$retrieved = ($i + $result.Items.Count) - 1
Write-Verbose "Retrieved $retrieved Calendars..."
if ($Limit -gt 0 -and $retrieved -eq $Limit) {
Write-Verbose "Limit reached: $Limit"
$overLimit = $true
}
elseif ($Limit -gt 0 -and ($retrieved + $PageSize) -gt $Limit) {
$newPS = $Limit - $retrieved
Write-Verbose ("Reducing PageSize from {0} to {1} to meet limit with next page" -f $PageSize,$newPS)
$request.MaxResults = $newPS
}
[int]$i = $i + $result.Items.Count
}
until (!$result.NextPageToken)
until ($overLimit -or !$result.NextPageToken)
}
catch {
if ($ErrorActionPreference -eq 'Stop') {
Expand Down
27 changes: 23 additions & 4 deletions PSGSuite/Public/Calendar/Get-GSCalendarACL.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ function Get-GSCalendarAcl {
.PARAMETER PageSize
Maximum number of events returned on one result page.
.PARAMETER Limit
The maximum amount of results you want returned. Exclude or set to 0 to return all results
.EXAMPLE
Get-GSCalendarACL -User me -CalendarID "primary"
Expand All @@ -46,7 +49,11 @@ function Get-GSCalendarAcl {
[parameter(Mandatory = $false, ParameterSetName = 'List')]
[ValidateRange(1,2500)]
[Int]
$PageSize = 2500
$PageSize = 2500,
[parameter(Mandatory = $false, ParameterSetName = 'List')]
[Alias('First')]
[Int]
$Limit = 0
)
Process {
foreach ($U in $User) {
Expand Down Expand Up @@ -81,11 +88,14 @@ function Get-GSCalendarAcl {
}
}
}
if ($PageSize) {
$request.MaxResults = $PageSize
if ($Limit -gt 0 -and $PageSize -gt $Limit) {
Write-Verbose ("Reducing PageSize from {0} to {1} to meet limit with first page" -f $PageSize,$Limit)
$PageSize = $Limit
}
$request.MaxResults = $PageSize
Write-Verbose "Getting ACL List of calendar '$calId' for user '$U'"
[int]$i = 1
$overLimit = $false
do {
$result = $request.Execute()
$result.Items | Add-Member -MemberType NoteProperty -Name 'User' -Value $U -PassThru | Add-Member -MemberType NoteProperty -Name 'CalendarId' -Value $calId -PassThru
Expand All @@ -94,9 +104,18 @@ function Get-GSCalendarAcl {
}
[int]$retrieved = ($i + $result.Items.Count) - 1
Write-Verbose "Retrieved $retrieved Calendar ACLs..."
if ($Limit -gt 0 -and $retrieved -eq $Limit) {
Write-Verbose "Limit reached: $Limit"
$overLimit = $true
}
elseif ($Limit -gt 0 -and ($retrieved + $PageSize) -gt $Limit) {
$newPS = $Limit - $retrieved
Write-Verbose ("Reducing PageSize from {0} to {1} to meet limit with next page" -f $PageSize,$newPS)
$request.MaxResults = $newPS
}
[int]$i = $i + $result.Items.Count
}
until (!$result.NextPageToken)
until ($overLimit -or !$result.NextPageToken)
}
}
}
Expand Down
Loading

0 comments on commit b3bfcf5

Please sign in to comment.