Skip to content

Commit

Permalink
!deploy v2.36.3
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 authored Mar 20, 2020
2 parents 0f61f25 + 8d369e3 commit b23841d
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 31 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
38 changes: 19 additions & 19 deletions psake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,24 @@ $deployScriptBlock = {
" [SKIPPED] Deployment of version [$($versionToDeploy)] to PSGallery"
}
$commitId = git rev-parse --verify HEAD
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)) {
" Publishing tweet about new release..."
$manifest = Import-PowerShellDataFile -Path (Join-Path $outputModVerDir "$($env:BHProjectName).psd1")
$text = "#$($env:BHProjectName) v$($versionToDeploy) is now available on the #PSGallery! https://www.powershellgallery.com/packages/$($env:BHProjectName)/$($versionToDeploy) #PowerShell"
$manifest.PrivateData.PSData.Tags | Foreach-Object {
$text += " #$($_)"
}
if ($text.Length -gt 280) {
" Trimming [$($text.Length - 280)] extra characters from tweet text to get to 280 character limit..."
$text = $text.Substring(0,280)
}
" Tweet text: $text"
Publish-Tweet -Tweet $text -ConsumerKey $env:TwitterConsumerKey -ConsumerSecret $env:TwitterConsumerSecret -AccessToken $env:TwitterAccessToken -AccessSecret $env:TwitterAccessSecret
" Tweet successful!"
}
else {
" [SKIPPED] Twitter update of new release"
}
if (-not [String]::IsNullOrEmpty($env:GitHubPAT)) {
" Creating Release ZIP..."
$zipPath = [System.IO.Path]::Combine($PSScriptRoot,"$($env:BHProjectName).zip")
Expand Down Expand Up @@ -556,7 +574,7 @@ $deployScriptBlock = {
CommitId = $commitId
ReleaseNotes = $ReleaseNotes
ArtifactPath = $zipPath
GitHubUsername = 'scrthq'
GitHubUsername = 'SCRT-HQ'
GitHubRepository = $env:BHProjectName
GitHubApiKey = $env:GitHubPAT
Draft = $false
Expand All @@ -567,24 +585,6 @@ $deployScriptBlock = {
else {
" [SKIPPED] Publishing Release v$($versionToDeploy) @ commit Id [$($commitId)] to GitHub"
}
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)) {
" Publishing tweet about new release..."
$manifest = Import-PowerShellDataFile -Path (Join-Path $outputModVerDir "$($env:BHProjectName).psd1")
$text = "#$($env:BHProjectName) v$($versionToDeploy) is now available on the #PSGallery! https://www.powershellgallery.com/packages/$($env:BHProjectName)/$($versionToDeploy) #PowerShell"
$manifest.PrivateData.PSData.Tags | Foreach-Object {
$text += " #$($_)"
}
if ($text.Length -gt 280) {
" Trimming [$($text.Length - 280)] extra characters from tweet text to get to 280 character limit..."
$text = $text.Substring(0,280)
}
" Tweet text: $text"
Publish-Tweet -Tweet $text -ConsumerKey $env:TwitterConsumerKey -ConsumerSecret $env:TwitterConsumerSecret -AccessToken $env:TwitterAccessToken -AccessSecret $env:TwitterAccessSecret
" Tweet successful!"
}
else {
" [SKIPPED] Twitter update of new release"
}
}
catch {
Write-Error $_ -ErrorAction Stop
Expand Down

0 comments on commit b23841d

Please sign in to comment.