diff --git a/CHANGELOG.md b/CHANGELOG.md index fa300e6a..4ea0793f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ * [PSGSuite - ChangeLog](#psgsuite---changelog) + * [2.36.4 - 2020-03-20](#2364---2020-03-20) * [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) @@ -110,6 +111,11 @@ # PSGSuite - ChangeLog +## 2.36.4 - 2020-03-20 + +* [Issue #270](https://github.com/scrthq/PSGSuite/issues/270) + * Corrected inaccurate warning that no licenses were found for a user when using the `CheckAll` switch on `Get-GSUserLicense`. + ## 2.36.3 - 2020-03-20 * [Issue #270](https://github.com/scrthq/PSGSuite/issues/270) diff --git a/PSGSuite/PSGSuite.psd1 b/PSGSuite/PSGSuite.psd1 index d7158ebc..12d5b4ac 100644 --- a/PSGSuite/PSGSuite.psd1 +++ b/PSGSuite/PSGSuite.psd1 @@ -12,7 +12,7 @@ RootModule = 'PSGSuite.psm1' # Version number of this module. - ModuleVersion = '2.36.3' + ModuleVersion = '2.36.4' # ID used to uniquely identify this module GUID = '9d751152-e83e-40bb-a6db-4c329092aaec' diff --git a/PSGSuite/Public/Licensing/Get-GSUserLicense.ps1 b/PSGSuite/Public/Licensing/Get-GSUserLicense.ps1 index 93c09156..7a216dbe 100644 --- a/PSGSuite/Public/Licensing/Get-GSUserLicense.ps1 +++ b/PSGSuite/Public/Licensing/Get-GSUserLicense.ps1 @@ -111,6 +111,7 @@ function Get-GSUserLicense { $request.Execute() } else { + $matchedLicense = $false foreach ($License in (Get-LicenseSkuFromDisplayName).Keys | Sort-Object) { $response = $null Write-Verbose "Getting License SKU '$License' for User '$U'" @@ -121,13 +122,15 @@ function Get-GSUserLicense { } catch {} if (-not $CheckAll -and $response) { + $matchedLicense = $true break } elseif ($response) { + $matchedLicense = $true $response } } - if (!$response) { + if (-not $matchedLicense) { Write-Warning "No license found for $U!" } } diff --git a/README.md b/README.md index 30a85c18..243017a3 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,11 @@ 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.4 - 2020-03-20 + +* [Issue #270](https://github.com/scrthq/PSGSuite/issues/270) + * Corrected inaccurate warning that no licenses were found for a user when using the `CheckAll` switch on `Get-GSUserLicense`. + #### 2.36.3 - 2020-03-20 * [Issue #270](https://github.com/scrthq/PSGSuite/issues/270)