Skip to content

Commit

Permalink
!deploy v2.26.0 - resolve #169 and resolve #168 and improve pipeline …
Browse files Browse the repository at this point in the history
…support

## 2.26.0

* [Issue #169](#169)
  * Fixed: `Get-GSGmailMessage` fails to download attachments containing invalid characters (e.g. `:`)
* [Issue #168](#168)
  * Added: `Add-GSUserLocation`
  * Updated: `New-GSUser` and `Update-GSUser` to add in Location support
* Miscellaneous
  * Improved pipeline support for the `User` parameter across all pertinent functions, i.e. Drive, Calendar, Gmail, Sheets & Tasks APIs.
  • Loading branch information
scrthq authored Mar 30, 2019
2 parents ac7bef1 + cb1f347 commit d7ae5ab
Show file tree
Hide file tree
Showing 74 changed files with 394 additions and 324 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

* [Changelog](#changelog)
* [2.26.0](#2260)
* [2.25.3](#2253)
* [2.25.2](#2252)
* [2.25.1](#2251)
Expand Down Expand Up @@ -81,6 +82,16 @@

***

## 2.26.0

* [Issue #169](https://github.com/scrthq/PSGSuite/issues/169)
* Fixed: `Get-GSGmailMessage` fails to download attachments containing invalid characters (e.g. `:`)
* [Issue #168](https://github.com/scrthq/PSGSuite/issues/168)
* Added: `Add-GSUserLocation`
* Updated: `New-GSUser` and `Update-GSUser` to add in Location support
* Miscellaneous
* Improved pipeline support for the `User` parameter across all pertinent functions, i.e. Drive, Calendar, Gmail, Sheets & Tasks APIs.

## 2.25.3

* Miscellaneous
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.25.3'
ModuleVersion = '2.26.0'

# ID used to uniquely identify this module
GUID = '9d751152-e83e-40bb-a6db-4c329092aaec'
Expand Down
4 changes: 1 addition & 3 deletions PSGSuite/Public/Classroom/Add-GSCourseParticipant.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function Add-GSCourseParticipant {
[String]
$User = $Script:PSGSuite.AdminEmail
)
Begin {
Process {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
Expand All @@ -64,8 +64,6 @@ function Add-GSCourseParticipant {
User = $User
}
$service = New-GoogleService @serviceParams
}
Process {
foreach ($part in $Student | Where-Object {-not [String]::IsNullOrEmpty($_)}) {
try {
$body = New-Object 'Google.Apis.Classroom.v1.Data.Student'
Expand Down
8 changes: 3 additions & 5 deletions PSGSuite/Public/Classroom/Confirm-GSCourseInvitation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ function Confirm-GSCourseInvitation {
[cmdletbinding()]
Param
(
[parameter(Mandatory = $true)]
[parameter(Mandatory = $true,ValueFromPipelineByPropertyName = $true)]
[String]
$Id,
[parameter(Mandatory = $true)]
[parameter(Mandatory = $true,ValueFromPipelineByPropertyName = $true)]
[String]
$User
)
Begin {
Process {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
Expand All @@ -38,8 +38,6 @@ function Confirm-GSCourseInvitation {
User = $User
}
$service = New-GoogleService @serviceParams
}
Process {
try {
Write-Verbose "Accepting Invitation '$Id' for user '$User'"
$request = $service.Invitations.Accept($Id)
Expand Down
8 changes: 3 additions & 5 deletions PSGSuite/Public/Classroom/Get-GSCourseParticipant.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function Get-GSCourseParticipant {
[cmdletbinding(DefaultParameterSetName = "List")]
Param
(
[parameter(Mandatory = $true,Position = 0,ValueFromPipelineByPropertyName)]
[parameter(Mandatory = $true,Position = 0,ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[alias('Id')]
[String]
Expand All @@ -61,14 +61,14 @@ function Get-GSCourseParticipant {
[parameter(Mandatory = $false,ParameterSetName = "Get")]
[String[]]
$Student,
[parameter(Mandatory = $false)]
[parameter(Mandatory = $false,ValueFromPipelineByPropertyName = $true)]
[String]
$User = $Script:PSGSuite.AdminEmail,
[parameter(Mandatory = $false)]
[String[]]
$Fields = '*'
)
Begin {
Process {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
Expand All @@ -85,8 +85,6 @@ function Get-GSCourseParticipant {
User = $User
}
$service = New-GoogleService @serviceParams
}
Process {
switch ($PSCmdlet.ParameterSetName) {
Get {
foreach ($part in $Student) {
Expand Down
6 changes: 2 additions & 4 deletions PSGSuite/Public/Classroom/Get-GSStudentGuardian.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ function Get-GSStudentGuardian {
[Alias('Guardian')]
[String[]]
$GuardianId,
[parameter(Mandatory = $false)]
[parameter(Mandatory = $false,ValueFromPipelineByPropertyName = $true)]
[String]
$User = $Script:PSGSuite.AdminEmail
)
Begin {
Process {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
Expand All @@ -55,8 +55,6 @@ function Get-GSStudentGuardian {
User = $User
}
$service = New-GoogleService @serviceParams
}
Process {
foreach ($stuId in $StudentId) {
try {
if ($stuId -ne '-') {
Expand Down
6 changes: 2 additions & 4 deletions PSGSuite/Public/Classroom/Get-GSStudentGuardianInvitation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ function Get-GSStudentGuardianInvitation {
[parameter(Mandatory = $false,ParameterSetName = "List")]
[Google.Apis.Classroom.v1.UserProfilesResource+GuardianInvitationsResource+ListRequest+StatesEnum[]]
$States,
[parameter(Mandatory = $false)]
[parameter(Mandatory = $false,ValueFromPipelineByPropertyName = $true)]
[String]
$User = $Script:PSGSuite.AdminEmail
)
Begin {
Process {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
Expand All @@ -73,8 +73,6 @@ function Get-GSStudentGuardianInvitation {
User = $User
}
$service = New-GoogleService @serviceParams
}
Process {
foreach ($stuId in $StudentId) {
try {
if ($stuId -ne '-') {
Expand Down
6 changes: 2 additions & 4 deletions PSGSuite/Public/Classroom/New-GSCourse.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ function New-GSCourse {
[ValidateSet('PROVISIONED','ACTIVE','ARCHIVED','DECLINED')]
[String]
$CourseState,
[parameter(Mandatory = $false)]
[parameter(Mandatory = $false,ValueFromPipelineByPropertyName = $true)]
[String]
$User = $Script:PSGSuite.AdminEmail
)
Begin {
Process {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
Expand All @@ -104,8 +104,6 @@ function New-GSCourse {
User = $User
}
$service = New-GoogleService @serviceParams
}
Process {
try {
Write-Verbose "Creating new Course '$Name'"
$body = New-Object 'Google.Apis.Classroom.v1.Data.Course'
Expand Down
26 changes: 13 additions & 13 deletions PSGSuite/Public/Classroom/New-GSCourseAlias.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,11 @@ function New-GSCourseAlias {
[ValidateSet('Domain','Project')]
[String]
$Scope = $(if($Alias -match "^p\:"){'Project'}else{'Domain'}),
[parameter(Mandatory = $false)]
[parameter(Mandatory = $false,ValueFromPipelineByPropertyName = $true)]
[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
$formatted = if ($Alias -match "^(d\:|p\:)") {
$Alias
$Scope = if ($Alias -match "^d\:") {
Expand All @@ -80,6 +68,18 @@ function New-GSCourseAlias {
}
}
Process {
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
try {
Write-Verbose "Creating new Alias '$Alias' for Course '$CourseId' at '$Scope' scope"
$body = New-Object 'Google.Apis.Classroom.v1.Data.CourseAlias' -Property @{
Expand Down
6 changes: 2 additions & 4 deletions PSGSuite/Public/Classroom/New-GSCourseInvitation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ function New-GSCourseInvitation {
[ValidateSet('STUDENT','TEACHER','OWNER')]
[String]
$Role = 'STUDENT',
[parameter(Mandatory = $false)]
[parameter(Mandatory = $false,ValueFromPipelineByPropertyName = $true)]
[String]
$User = $Script:PSGSuite.AdminEmail
)
Begin {
Process {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
Expand All @@ -61,8 +61,6 @@ function New-GSCourseInvitation {
User = $User
}
$service = New-GoogleService @serviceParams
}
Process {
foreach ($U in $UserId) {
try {
if ( -not ($U -as [decimal])) {
Expand Down
6 changes: 2 additions & 4 deletions PSGSuite/Public/Classroom/New-GSStudentGuardianInvitation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ function New-GSStudentGuardianInvitation {
[Alias('Guardian')]
[String]
$GuardianEmail,
[parameter(Mandatory = $false)]
[parameter(Mandatory = $false,ValueFromPipelineByPropertyName = $true)]
[String]
$User = $Script:PSGSuite.AdminEmail
)
Begin {
Process {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
Expand All @@ -60,8 +60,6 @@ function New-GSStudentGuardianInvitation {
User = $User
}
$service = New-GoogleService @serviceParams
}
Process {
try {
if ( -not ($StudentId -as [decimal])) {
if ($StudentId -ceq 'me') {
Expand Down
6 changes: 2 additions & 4 deletions PSGSuite/Public/Classroom/Remove-GSCourse.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ function Remove-GSCourse {
[Alias('Alias')]
[String]
$Id,
[parameter(Mandatory = $false)]
[parameter(Mandatory = $false,ValueFromPipelineByPropertyName = $true)]
[String]
$User = $Script:PSGSuite.AdminEmail
)
Begin {
Process {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
Expand All @@ -39,8 +39,6 @@ function Remove-GSCourse {
User = $User
}
$service = New-GoogleService @serviceParams
}
Process {
try {
if ($PSCmdlet.ShouldProcess("Removing Course '$Id'")) {
Write-Verbose "Removing Course '$Id'"
Expand Down
6 changes: 2 additions & 4 deletions PSGSuite/Public/Classroom/Remove-GSCourseAlias.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ function Remove-GSCourseAlias {
[parameter(Mandatory = $true,Position = 1)]
[String]
$CourseId,
[parameter(Mandatory = $false)]
[parameter(Mandatory = $false,ValueFromPipelineByPropertyName = $true)]
[String]
$User = $Script:PSGSuite.AdminEmail
)
Begin {
Process {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
Expand All @@ -44,8 +44,6 @@ function Remove-GSCourseAlias {
User = $User
}
$service = New-GoogleService @serviceParams
}
Process {
try {
if ($PSCmdlet.ShouldProcess("Removing Alias '$Alias' for Course '$CourseId'")) {
Write-Verbose "Removing Alias '$Alias' for Course '$CourseId'"
Expand Down
6 changes: 2 additions & 4 deletions PSGSuite/Public/Classroom/Remove-GSCourseInvitation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ function Remove-GSCourseInvitation {
[parameter(Mandatory = $true,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)]
[String[]]
$Id,
[parameter(Mandatory = $false)]
[parameter(Mandatory = $false,ValueFromPipelineByPropertyName = $true)]
[String]
$User = $Script:PSGSuite.AdminEmail
)
Begin {
Process {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
Expand All @@ -38,8 +38,6 @@ function Remove-GSCourseInvitation {
User = $User
}
$service = New-GoogleService @serviceParams
}
Process {
foreach ($I in $Id) {
try {
if ($PSCmdlet.ShouldProcess("Removing Invitation '$I'")) {
Expand Down
6 changes: 2 additions & 4 deletions PSGSuite/Public/Classroom/Remove-GSCourseParticipant.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ function Remove-GSCourseParticipant {
[parameter(Mandatory = $false)]
[String[]]
$Teacher,
[parameter(Mandatory = $false)]
[parameter(Mandatory = $false,ValueFromPipelineByPropertyName = $true)]
[String]
$User = $Script:PSGSuite.AdminEmail
)
Begin {
Process {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
Expand All @@ -63,8 +63,6 @@ function Remove-GSCourseParticipant {
User = $User
}
$service = New-GoogleService @serviceParams
}
Process {
foreach ($part in $Student) {
try {
if ( -not ($part -as [decimal])) {
Expand Down
6 changes: 2 additions & 4 deletions PSGSuite/Public/Classroom/Remove-GSStudentGuardian.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ function Remove-GSStudentGuardian {
[Alias('Guardian')]
[String]
$GuardianId,
[parameter(Mandatory = $false)]
[parameter(Mandatory = $false,ValueFromPipelineByPropertyName = $true)]
[String]
$User = $Script:PSGSuite.AdminEmail
)
Begin {
Process {
if ($User -ceq 'me') {
$User = $Script:PSGSuite.AdminEmail
}
Expand All @@ -52,8 +52,6 @@ function Remove-GSStudentGuardian {
User = $User
}
$service = New-GoogleService @serviceParams
}
Process {
try {
if ( -not ($StudentId -as [decimal])) {
if ($StudentId -ceq 'me') {
Expand Down
Loading

0 comments on commit d7ae5ab

Please sign in to comment.