Skip to content

Commit b23841d

Browse files
authored
!deploy v2.36.3
## 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.
2 parents 0f61f25 + 8d369e3 commit b23841d

8 files changed

+54
-31
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
* [PSGSuite - ChangeLog](#psgsuite---changelog)
2+
* [2.36.3 - 2020-03-20](#2363---2020-03-20)
23
* [2.36.2 - 2020-03-02](#2362---2020-03-02)
34
* [2.36.1 - 2020-03-02](#2361---2020-03-02)
45
* [2.36.0 - 2020-02-28](#2360---2020-02-28)
@@ -109,6 +110,14 @@
109110

110111
# PSGSuite - ChangeLog
111112

113+
## 2.36.3 - 2020-03-20
114+
115+
* [Issue #270](https://github.com/scrthq/PSGSuite/issues/270)
116+
* Added `CheckAll` switch parameter to `Get-GSUserLicense`
117+
* Updated `User` parameter aliases for all `*-GSUserLicense` functions to include `UserId` for better pipeline support.
118+
* Miscellaneous
119+
* Updated GitHub Release section in psake.ps1 to POST the release to the Org URL due to failures.
120+
112121
## 2.36.2 - 2020-03-02
113122

114123
* [Issue #263](https://github.com/scrthq/PSGSuite/issues/263)

PSGSuite/PSGSuite.psd1

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'PSGSuite.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '2.36.2'
15+
ModuleVersion = '2.36.3'
1616

1717
# ID used to uniquely identify this module
1818
GUID = '9d751152-e83e-40bb-a6db-4c329092aaec'

PSGSuite/Public/Licensing/Get-GSUserLicense.ps1

+14-8
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ function Get-GSUserLicense {
2121
.PARAMETER Limit
2222
The maximum amount of results you want returned. Exclude or set to 0 to return all results
2323
24+
.PARAMETER CheckAll
25+
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.
26+
2427
.EXAMPLE
2528
Get-GSUserLicense
2629
@@ -31,7 +34,7 @@ function Get-GSUserLicense {
3134
Param
3235
(
3336
[parameter(Mandatory = $false, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = "Get")]
34-
[Alias("PrimaryEmail", "UserKey", "Mail")]
37+
[Alias("PrimaryEmail", "UserKey", "Mail","UserId")]
3538
[ValidateNotNullOrEmpty()]
3639
[String[]]
3740
$User,
@@ -43,7 +46,10 @@ function Get-GSUserLicense {
4346
[parameter(Mandatory = $false, ParameterSetName = "List")]
4447
[Alias('First')]
4548
[Int]
46-
$Limit = 0
49+
$Limit = 0,
50+
[parameter(ParameterSetName = "Get")]
51+
[Switch]
52+
$CheckAll
4753
)
4854
DynamicParam {
4955
$paramDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary
@@ -106,24 +112,24 @@ function Get-GSUserLicense {
106112
}
107113
else {
108114
foreach ($License in (Get-LicenseSkuFromDisplayName).Keys | Sort-Object) {
115+
$response = $null
109116
Write-Verbose "Getting License SKU '$License' for User '$U'"
110117
$License = Get-LicenseSkuFromDisplayName $License
111118
try {
112119
$request = $service.LicenseAssignments.Get((Get-LicenseSkuToProductHash $License), $License, $U)
113120
$response = $request.Execute()
114121
}
115-
catch {
116-
}
117-
if ($response) {
122+
catch {}
123+
if (-not $CheckAll -and $response) {
118124
break
119125
}
126+
elseif ($response) {
127+
$response
128+
}
120129
}
121130
if (!$response) {
122131
Write-Warning "No license found for $U!"
123132
}
124-
else {
125-
$response
126-
}
127133
}
128134
}
129135
}

PSGSuite/Public/Licensing/Remove-GSUserLicense.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Remove-GSUserLicense {
2121
Param
2222
(
2323
[parameter(Mandatory = $true,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)]
24-
[Alias("PrimaryEmail","UserKey","Mail")]
24+
[Alias("PrimaryEmail","UserKey","Mail","UserId")]
2525
[ValidateNotNullOrEmpty()]
2626
[string[]]
2727
$User

PSGSuite/Public/Licensing/Set-GSUserLicense.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function Set-GSUserLicense {
2222
Param
2323
(
2424
[parameter(Mandatory = $true,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)]
25-
[Alias("PrimaryEmail","UserKey","Mail")]
25+
[Alias("PrimaryEmail","UserKey","Mail","UserId")]
2626
[ValidateNotNullOrEmpty()]
2727
[String[]]
2828
$User

PSGSuite/Public/Licensing/Update-GSUserLicense.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function Update-GSUserLicense {
2222
Param
2323
(
2424
[parameter(Mandatory = $false,Position = 0,ValueFromPipeline = $true,ValueFromPipelineByPropertyName = $true)]
25-
[Alias("PrimaryEmail","UserKey","Mail")]
25+
[Alias("PrimaryEmail","UserKey","Mail","UserId")]
2626
[ValidateNotNullOrEmpty()]
2727
[String[]]
2828
$User

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ All other functions are either intact or have an alias included to support backw
158158

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

161+
#### 2.36.3 - 2020-03-20
162+
163+
* [Issue #270](https://github.com/scrthq/PSGSuite/issues/270)
164+
* Added `CheckAll` switch parameter to `Get-GSUserLicense`
165+
* Updated `User` parameter aliases for all `*-GSUserLicense` functions to include `UserId` for better pipeline support.
166+
* Miscellaneous
167+
* Updated GitHub Release section in psake.ps1 to POST the release to the Org URL due to failures.
168+
161169
#### 2.36.2 - 2020-03-02
162170

163171
* [Issue #263](https://github.com/scrthq/PSGSuite/issues/263)

psake.ps1

+19-19
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,24 @@ $deployScriptBlock = {
521521
" [SKIPPED] Deployment of version [$($versionToDeploy)] to PSGallery"
522522
}
523523
$commitId = git rev-parse --verify HEAD
524+
if ($ENV:BHBuildSystem -eq 'VSTS' -and -not [String]::IsNullOrEmpty($env:TwitterAccessSecret) -and -not [String]::IsNullOrEmpty($env:TwitterAccessToken) -and -not [String]::IsNullOrEmpty($env:TwitterConsumerKey) -and -not [String]::IsNullOrEmpty($env:TwitterConsumerSecret)) {
525+
" Publishing tweet about new release..."
526+
$manifest = Import-PowerShellDataFile -Path (Join-Path $outputModVerDir "$($env:BHProjectName).psd1")
527+
$text = "#$($env:BHProjectName) v$($versionToDeploy) is now available on the #PSGallery! https://www.powershellgallery.com/packages/$($env:BHProjectName)/$($versionToDeploy) #PowerShell"
528+
$manifest.PrivateData.PSData.Tags | Foreach-Object {
529+
$text += " #$($_)"
530+
}
531+
if ($text.Length -gt 280) {
532+
" Trimming [$($text.Length - 280)] extra characters from tweet text to get to 280 character limit..."
533+
$text = $text.Substring(0,280)
534+
}
535+
" Tweet text: $text"
536+
Publish-Tweet -Tweet $text -ConsumerKey $env:TwitterConsumerKey -ConsumerSecret $env:TwitterConsumerSecret -AccessToken $env:TwitterAccessToken -AccessSecret $env:TwitterAccessSecret
537+
" Tweet successful!"
538+
}
539+
else {
540+
" [SKIPPED] Twitter update of new release"
541+
}
524542
if (-not [String]::IsNullOrEmpty($env:GitHubPAT)) {
525543
" Creating Release ZIP..."
526544
$zipPath = [System.IO.Path]::Combine($PSScriptRoot,"$($env:BHProjectName).zip")
@@ -556,7 +574,7 @@ $deployScriptBlock = {
556574
CommitId = $commitId
557575
ReleaseNotes = $ReleaseNotes
558576
ArtifactPath = $zipPath
559-
GitHubUsername = 'scrthq'
577+
GitHubUsername = 'SCRT-HQ'
560578
GitHubRepository = $env:BHProjectName
561579
GitHubApiKey = $env:GitHubPAT
562580
Draft = $false
@@ -567,24 +585,6 @@ $deployScriptBlock = {
567585
else {
568586
" [SKIPPED] Publishing Release v$($versionToDeploy) @ commit Id [$($commitId)] to GitHub"
569587
}
570-
if ($ENV:BHBuildSystem -eq 'VSTS' -and -not [String]::IsNullOrEmpty($env:TwitterAccessSecret) -and -not [String]::IsNullOrEmpty($env:TwitterAccessToken) -and -not [String]::IsNullOrEmpty($env:TwitterConsumerKey) -and -not [String]::IsNullOrEmpty($env:TwitterConsumerSecret)) {
571-
" Publishing tweet about new release..."
572-
$manifest = Import-PowerShellDataFile -Path (Join-Path $outputModVerDir "$($env:BHProjectName).psd1")
573-
$text = "#$($env:BHProjectName) v$($versionToDeploy) is now available on the #PSGallery! https://www.powershellgallery.com/packages/$($env:BHProjectName)/$($versionToDeploy) #PowerShell"
574-
$manifest.PrivateData.PSData.Tags | Foreach-Object {
575-
$text += " #$($_)"
576-
}
577-
if ($text.Length -gt 280) {
578-
" Trimming [$($text.Length - 280)] extra characters from tweet text to get to 280 character limit..."
579-
$text = $text.Substring(0,280)
580-
}
581-
" Tweet text: $text"
582-
Publish-Tweet -Tweet $text -ConsumerKey $env:TwitterConsumerKey -ConsumerSecret $env:TwitterConsumerSecret -AccessToken $env:TwitterAccessToken -AccessSecret $env:TwitterAccessSecret
583-
" Tweet successful!"
584-
}
585-
else {
586-
" [SKIPPED] Twitter update of new release"
587-
}
588588
}
589589
catch {
590590
Write-Error $_ -ErrorAction Stop

0 commit comments

Comments
 (0)