Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.22.1 #141

Merged
merged 11 commits into from
Dec 29, 2018
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
## 2.22.1

* Added Remove-GSDriveFile
* Added Get-GSCalendarList
* Get-GSCalendarSubscription: Added support for more than 100 results, ShowHidden & ShowDeleted parameters.

## 2.22.0

Expand Down
71 changes: 0 additions & 71 deletions PSGSuite/Public/Calendar/Get-GSCalendarList.ps1

This file was deleted.

29 changes: 27 additions & 2 deletions PSGSuite/Public/Calendar/Get-GSCalendarSubscription.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ function Get-GSCalendarSubscription {
.PARAMETER CalendarID
The calendar ID of the calendar you would like to get info for. If left blank, returns the list of calendars the user is subscribed to.

.PARAMETER ShowDeleted
Whether to include deleted calendar list entries in the result. Optional. The default is False.

.PARAMETER ShowHidden
Whether to show hidden entries. Optional. The default is False.

.EXAMPLE
Get-GSCalendarSubscription

Expand All @@ -30,7 +36,13 @@ function Get-GSCalendarSubscription {
$User = $Script:PSGSuite.AdminEmail,
[parameter(Mandatory = $false,Position = 1)]
[String[]]
$CalendarId
$CalendarId,
[Parameter(Mandatory = $false, Position = 2)]
[bool]
$ShowDeleted = $false,
scrthq marked this conversation as resolved.
Show resolved Hide resolved
[Parameter(Mandatory = $false, Position = 3)]
[bool]
$ShowHidden = $false
)
Begin {
if ($User -ceq 'me') {
Expand Down Expand Up @@ -68,7 +80,20 @@ function Get-GSCalendarSubscription {
try {
Write-Verbose "Getting subscribed calendar list for user '$User'"
$request = $service.CalendarList.List()
$request.Execute() | Select-Object -ExpandProperty Items
If ($ShowDeleted -eq $true){
$request.$ShowDeleted = $true
}
If ($ShowHidden -eq $true){
$request.$ShowHidden = $true
}
$raw = $request.Execute()
$ItemList = [object[]]($raw | Select-Object -ExpandProperty Items)
scrthq marked this conversation as resolved.
Show resolved Hide resolved
While ($Null -ne $raw.NextPageToken){
$request.SetPageToken($raw.NextPageToken)
$raw = $request.Execute()
$ItemList += $raw | Select-Object -ExpandProperty Items
}
$ItemList
}
catch {
if ($ErrorActionPreference -eq 'Stop') {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Update-GSSheetValue Export-GSSheet
## 2.22.1

* Added Remove-GSDriveFile
* Added Get-GSCalendarList
* Get-GSCalendarSubscription: Added support for more than 100 results, ShowHidden & ShowDeleted parameters.

#### 2.22.0

Expand Down