Skip to content

Commit

Permalink
v2.36.3 ready for release
Browse files Browse the repository at this point in the history
## 2.36.3 - 2020-03-20

* [Issue #270](#270)
    * Added `CheckAll` switch parameter to `Get-GSUserLicense`
    * Updated `User` parameter aliases for all `*-GSUserLicense` functions to include `UserId` for better pipeline support.
* Miscellaneous
    * Updated GitHub Release section in psake.ps1 to POST the release to the Org URL due to failures.
  • Loading branch information
scrthq committed Mar 20, 2020
1 parent 0f61f25 commit 235f2df
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 13 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* [PSGSuite - ChangeLog](#psgsuite---changelog)
* [2.36.3 - 2020-03-20](#2363---2020-03-20)
* [2.36.2 - 2020-03-02](#2362---2020-03-02)
* [2.36.1 - 2020-03-02](#2361---2020-03-02)
* [2.36.0 - 2020-02-28](#2360---2020-02-28)
Expand Down Expand Up @@ -109,6 +110,14 @@

# PSGSuite - ChangeLog

## 2.36.3 - 2020-03-20

* [Issue #270](https://github.com/scrthq/PSGSuite/issues/270)
* Added `CheckAll` switch parameter to `Get-GSUserLicense`
* Updated `User` parameter aliases for all `*-GSUserLicense` functions to include `UserId` for better pipeline support.
* Miscellaneous
* Updated GitHub Release section in psake.ps1 to POST the release to the Org URL due to failures.

## 2.36.2 - 2020-03-02

* [Issue #263](https://github.com/scrthq/PSGSuite/issues/263)
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.36.2'
ModuleVersion = '2.36.3'

# ID used to uniquely identify this module
GUID = '9d751152-e83e-40bb-a6db-4c329092aaec'
Expand Down
22 changes: 14 additions & 8 deletions PSGSuite/Public/Licensing/Get-GSUserLicense.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ function Get-GSUserLicense {
.PARAMETER Limit
The maximum amount of results you want returned. Exclude or set to 0 to return all results
.PARAMETER CheckAll
If $true, force a check of all license products when specifying a User. This will return all license types it finds for a specific user instead of the default behavior of short circuiting after matching against the first license assigned.
.EXAMPLE
Get-GSUserLicense
Expand All @@ -31,7 +34,7 @@ function Get-GSUserLicense {
Param
(
[parameter(Mandatory = $false, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = "Get")]
[Alias("PrimaryEmail", "UserKey", "Mail")]
[Alias("PrimaryEmail", "UserKey", "Mail","UserId")]
[ValidateNotNullOrEmpty()]
[String[]]
$User,
Expand All @@ -43,7 +46,10 @@ function Get-GSUserLicense {
[parameter(Mandatory = $false, ParameterSetName = "List")]
[Alias('First')]
[Int]
$Limit = 0
$Limit = 0,
[parameter(ParameterSetName = "Get")]
[Switch]
$CheckAll
)
DynamicParam {
$paramDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary
Expand Down Expand Up @@ -106,24 +112,24 @@ function Get-GSUserLicense {
}
else {
foreach ($License in (Get-LicenseSkuFromDisplayName).Keys | Sort-Object) {
$response = $null
Write-Verbose "Getting License SKU '$License' for User '$U'"
$License = Get-LicenseSkuFromDisplayName $License
try {
$request = $service.LicenseAssignments.Get((Get-LicenseSkuToProductHash $License), $License, $U)
$response = $request.Execute()
}
catch {
}
if ($response) {
catch {}
if (-not $CheckAll -and $response) {
break
}
elseif ($response) {
$response
}
}
if (!$response) {
Write-Warning "No license found for $U!"
}
else {
$response
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion PSGSuite/Public/Licensing/Remove-GSUserLicense.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Remove-GSUserLicense {
Param
(
[parameter(Mandatory = $true,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)]
[Alias("PrimaryEmail","UserKey","Mail")]
[Alias("PrimaryEmail","UserKey","Mail","UserId")]
[ValidateNotNullOrEmpty()]
[string[]]
$User
Expand Down
2 changes: 1 addition & 1 deletion PSGSuite/Public/Licensing/Set-GSUserLicense.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Set-GSUserLicense {
Param
(
[parameter(Mandatory = $true,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)]
[Alias("PrimaryEmail","UserKey","Mail")]
[Alias("PrimaryEmail","UserKey","Mail","UserId")]
[ValidateNotNullOrEmpty()]
[String[]]
$User
Expand Down
2 changes: 1 addition & 1 deletion PSGSuite/Public/Licensing/Update-GSUserLicense.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Update-GSUserLicense {
Param
(
[parameter(Mandatory = $false,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)]
[Alias("PrimaryEmail","UserKey","Mail")]
[Alias("PrimaryEmail","UserKey","Mail","UserId")]
[ValidateNotNullOrEmpty()]
[String[]]
$User
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ All other functions are either intact or have an alias included to support backw

[Full CHANGELOG here](https://github.com/scrthq/PSGSuite/blob/master/CHANGELOG.md)

#### 2.36.3 - 2020-03-20

* [Issue #270](https://github.com/scrthq/PSGSuite/issues/270)
* Added `CheckAll` switch parameter to `Get-GSUserLicense`
* Updated `User` parameter aliases for all `*-GSUserLicense` functions to include `UserId` for better pipeline support.
* Miscellaneous
* Updated GitHub Release section in psake.ps1 to POST the release to the Org URL due to failures.

#### 2.36.2 - 2020-03-02

* [Issue #263](https://github.com/scrthq/PSGSuite/issues/263)
Expand Down
2 changes: 1 addition & 1 deletion psake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ $deployScriptBlock = {
CommitId = $commitId
ReleaseNotes = $ReleaseNotes
ArtifactPath = $zipPath
GitHubUsername = 'scrthq'
GitHubUsername = 'SCRT-HQ'
GitHubRepository = $env:BHProjectName
GitHubApiKey = $env:GitHubPAT
Draft = $false
Expand Down

0 comments on commit 235f2df

Please sign in to comment.