Skip to content

Commit

Permalink
!build v2.15.1 for #87 and #90
Browse files Browse the repository at this point in the history
  • Loading branch information
scrthq committed Oct 5, 2018
1 parent 17b58f5 commit 86e7bab
Show file tree
Hide file tree
Showing 24 changed files with 461 additions and 98 deletions.
101 changes: 55 additions & 46 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,64 @@

<!-- TOC -->

* [Changelog](#changelog)
* [2.15.0](#2150)
* [2.14.1](#2141)
* [2.14.0](#2140)
* [2.13.2](#2132)
* [2.13.1](#2131)
* [2.13.0](#2130)
* [2.12.1](#2121)
* [2.12.0](#2120)
* [2.11.0](#2110)
* [2.10.2](#2102)
* [2.10.1](#2101)
* [2.10.0](#2100)
* [2.9.0](#290)
* [2.8.1](#281)
* [2.8.0](#280)
* [2.7.2](#272)
* [2.7.1](#271)
* [2.7.0](#270)
* [2.6.3](#263)
* [2.6.2](#262)
* [2.6.1](#261)
* [2.6.0](#260)
* [2.5.4](#254)
* [2.5.3](#253)
* [2.5.2](#252)
* [2.5.1](#251)
* [2.5.0](#250)
* [2.4.0](#240)
* [2.3.0](#230)
* [2.2.1](#221)
* [2.2.0](#220)
* [2.1.5](#215)
* [2.1.3 / 2.1.4](#213--214)
* [2.1.2](#212)
* [2.1.1](#211)
* [2.1.0](#210)
* [2.0.3](#203)
* [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)
- [Changelog](#changelog)
- [2.15.1](#2151)
- [2.15.0](#2150)
- [2.14.1](#2141)
- [2.14.0](#2140)
- [2.13.2](#2132)
- [2.13.1](#2131)
- [2.13.0](#2130)
- [2.12.1](#2121)
- [2.12.0](#2120)
- [2.11.0](#2110)
- [2.10.2](#2102)
- [2.10.1](#2101)
- [2.10.0](#2100)
- [2.9.0](#290)
- [2.8.1](#281)
- [2.8.0](#280)
- [2.7.2](#272)
- [2.7.1](#271)
- [2.7.0](#270)
- [2.6.3](#263)
- [2.6.2](#262)
- [2.6.1](#261)
- [2.6.0](#260)
- [2.5.4](#254)
- [2.5.3](#253)
- [2.5.2](#252)
- [2.5.1](#251)
- [2.5.0](#250)
- [2.4.0](#240)
- [2.3.0](#230)
- [2.2.1](#221)
- [2.2.0](#220)
- [2.1.5](#215)
- [2.1.3 / 2.1.4](#213--214)
- [2.1.2](#212)
- [2.1.1](#211)
- [2.1.0](#210)
- [2.0.3](#203)
- [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)

<!-- /TOC -->

## 2.15.1

* [Issue #87](https://github.com/scrthq/PSGSuite/issues/87)
* Added `User` parameter to all Classroom functions to specify which user to authenticate the request as
* [Issue #90](https://github.com/scrthq/PSGSuite/issues/90)
* Added `Update-GSUserPhoto`
* Added `Remove-GSUserPhoto`

## 2.15.0

- Updated Gmail Delegation functions to use the .NET SDK after Google announced delegation support for the Gmail API
Expand Down
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.15.0'
ModuleVersion = '2.15.1'

# ID used to uniquely identify this module
GUID = '9d751152-e83e-40bb-a6db-4c329092aaec'
Expand Down
46 changes: 23 additions & 23 deletions PSGSuite/Private/Get-MimeType.ps1
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
function Get-MimeType {
function Get-MimeType {
Param
(
[parameter(Mandatory=$true, ValueFromPipeline=$true,Position = 0)]
[System.IO.FileInfo]
$File
)
)
$mimeHash = @{
xls = 'application/vnd.ms-excel'
xlsx = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
xml = 'text/xml'
ods = 'application/vnd.oasis.opendocument.spreadsheet'
csv = 'text/plain'
tmpl = 'text/plain'
pdf = 'application/pdf'
php = 'application/x-httpd-php'
jpg = 'image/jpeg'
png = 'image/png'
gif = 'image/gif'
arj = 'application/arj'
bmp = 'image/bmp'
txt = 'text/plain'
md = 'text/plain'
log = 'text/plain'
cab = 'application/cab'
csv = 'text/plain'
doc = 'application/msword'
gif = 'image/gif'
htm = 'text/html'
html = 'text/html'
jpg = 'image/jpeg'
js = 'text/js'
swf = 'application/x-shockwave-flash'
log = 'text/plain'
md = 'text/plain'
mp3 = 'audio/mpeg'
zip = 'application/zip'
ods = 'application/vnd.oasis.opendocument.spreadsheet'
pdf = 'application/pdf'
php = 'application/x-httpd-php'
png = 'image/png'
rar = 'application/rar'
swf = 'application/x-shockwave-flash'
tar = 'application/tar'
arj = 'application/arj'
cab = 'application/cab'
html = 'text/html'
htm = 'text/html'
tmpl = 'text/plain'
txt = 'text/plain'
xls = 'application/vnd.ms-excel'
xlsx = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
xml = 'text/xml'
zip = 'application/zip'
}
if ($File.PSIsContainer) {
'application/vnd.google-apps.folder'
}
elseif ($mime = $mimeHash[$file.Extension]) {
elseif ($mime = $mimeHash["$($file.Extension.TrimStart('.'))"]) {
$mime
}
else {
Expand Down
15 changes: 14 additions & 1 deletion PSGSuite/Public/Classroom/Add-GSCourseParticipant.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ function Add-GSCourseParticipant {
* the email address of the user
* the string literal "me", indicating the requesting user
.PARAMETER User
The user to authenticate the request as
.EXAMPLE
Add-GSCourseParticipant -CourseId 'architecture-101' -Student [email protected],[email protected] -Teacher [email protected]
#>
Expand All @@ -42,12 +45,22 @@ function Add-GSCourseParticipant {
$Student,
[parameter(Mandatory = $false,ValueFromPipelineByPropertyName = $true)]
[String[]]
$Teacher
$Teacher,
[parameter(Mandatory = $false)]
[String]
$User = $Script:PSGSuite.AdminEmail
)
Begin {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
elseif ($User -notlike "*@*.*") {
$User = "$($User)@$($Script:PSGSuite.Domain)"
}
$serviceParams = @{
Scope = 'https://www.googleapis.com/auth/classroom.rosters'
ServiceType = 'Google.Apis.Classroom.v1.ClassroomService'
User = $User
}
$service = New-GoogleService @serviceParams
}
Expand Down
20 changes: 13 additions & 7 deletions PSGSuite/Public/Classroom/Get-GSCourse.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ function Get-GSCourse {
If excluded, returns the list of courses.
.PARAMETER User
The user to request course information as
.PARAMETER Teacher
Restricts returned courses to those having a teacher with the specified identifier. The identifier can be one of the following:
Expand All @@ -31,6 +28,9 @@ function Get-GSCourse {
.PARAMETER CourseStates
Restricts returned courses to those in one of the specified states.
.PARAMETER User
The user to authenticate the request as
.EXAMPLE
Get-GSCourse -Teacher [email protected]
#>
Expand All @@ -41,9 +41,6 @@ function Get-GSCourse {
[ValidateNotNullOrEmpty()]
[String[]]
$Id,
[parameter(Mandatory = $false)]
[String]
$User = $Script:PSGSuite.AdminEmail,
[parameter(Mandatory = $false,ParameterSetName = "List")]
[String]
$Teacher,
Expand All @@ -52,9 +49,18 @@ function Get-GSCourse {
$Student,
[parameter(Mandatory = $false,ParameterSetName = "List")]
[Google.Apis.Classroom.v1.CoursesResource+ListRequest+CourseStatesEnum[]]
$CourseStates
$CourseStates,
[parameter(Mandatory = $false)]
[String]
$User = $Script:PSGSuite.AdminEmail
)
Begin {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
elseif ($User -notlike "*@*.*") {
$User = "$($User)@$($Script:PSGSuite.Domain)"
}
$serviceParams = @{
Scope = 'https://www.googleapis.com/auth/classroom.courses'
ServiceType = 'Google.Apis.Classroom.v1.ClassroomService'
Expand Down
15 changes: 14 additions & 1 deletion PSGSuite/Public/Classroom/Get-GSCourseAlias.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ function Get-GSCourseAlias {
.PARAMETER CourseId
Identifier of the course to alias. This identifier can be either the Classroom-assigned identifier or an alias.
.PARAMETER User
The user to authenticate the request as
.EXAMPLE
Get-GSCourseAlias -CourseId 'architecture-101'
#>
Expand All @@ -17,12 +20,22 @@ function Get-GSCourseAlias {
(
[parameter(Mandatory = $true,Position = 0)]
[String]
$CourseId
$CourseId,
[parameter(Mandatory = $false)]
[String]
$User = $Script:PSGSuite.AdminEmail
)
Begin {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
elseif ($User -notlike "*@*.*") {
$User = "$($User)@$($Script:PSGSuite.Domain)"
}
$serviceParams = @{
Scope = 'https://www.googleapis.com/auth/classroom.courses'
ServiceType = 'Google.Apis.Classroom.v1.ClassroomService'
User = $User
}
$service = New-GoogleService @serviceParams
}
Expand Down
15 changes: 14 additions & 1 deletion PSGSuite/Public/Classroom/Get-GSCourseInvitation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ function Get-GSCourseInvitation {
* the email address of the user
* the string literal "me", indicating the requesting user
.PARAMETER User
The user to authenticate the request as
.EXAMPLE
Get-GSCourseInvitation -CourseId philosophy-101
#>
Expand All @@ -33,12 +36,22 @@ function Get-GSCourseInvitation {
$CourseId,
[parameter(Mandatory = $false,ParameterSetName = "List")]
[String]
$UserId
$UserId,
[parameter(Mandatory = $false)]
[String]
$User = $Script:PSGSuite.AdminEmail
)
Begin {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
elseif ($User -notlike "*@*.*") {
$User = "$($User)@$($Script:PSGSuite.Domain)"
}
$serviceParams = @{
Scope = 'https://www.googleapis.com/auth/classroom.rosters'
ServiceType = 'Google.Apis.Classroom.v1.ClassroomService'
User = $User
}
$service = New-GoogleService @serviceParams
}
Expand Down
15 changes: 14 additions & 1 deletion PSGSuite/Public/Classroom/Get-GSCourseParticipant.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ function Get-GSCourseParticipant {
* the email address of the user
* the string literal "me", indicating the requesting user
.PARAMETER User
The user to authenticate the request as
.EXAMPLE
Get-GSCourseParticipant -Teacher [email protected]
#>
Expand All @@ -52,12 +55,22 @@ function Get-GSCourseParticipant {
$Teacher,
[parameter(Mandatory = $false,ParameterSetName = "Get")]
[String[]]
$Student
$Student,
[parameter(Mandatory = $false)]
[String]
$User = $Script:PSGSuite.AdminEmail
)
Begin {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
elseif ($User -notlike "*@*.*") {
$User = "$($User)@$($Script:PSGSuite.Domain)"
}
$serviceParams = @{
Scope = 'https://www.googleapis.com/auth/classroom.rosters'
ServiceType = 'Google.Apis.Classroom.v1.ClassroomService'
User = $User
}
$service = New-GoogleService @serviceParams
}
Expand Down
Loading

0 comments on commit 86e7bab

Please sign in to comment.