Skip to content

Instantly share code, notes, and snippets.

@corbob
Created March 10, 2018 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corbob/c8fdbabf78c4c174b80ff8d14f871eda to your computer and use it in GitHub Desktop.
Save corbob/c8fdbabf78c4c174b80ff8d14f871eda to your computer and use it in GitHub Desktop.
why? But Why...
$licenses = Import-Csv $PSScriptRoot\LicenseCounts.csv
[Array]::Reverse($licenses)
$licenses = $licenses[0] | select *available*,*delta*
if($licenses.'E3 Available' -ge 25) {
write-output "E3 greater than or equal to 25: $($licenses.'E3 Available')"
$E3AvailableStyle = 'good'
} elseif ($licenses.'E3 Available' -ge 10 -and $licenses.'E3 Available' -lt 25) {
$E3AvailableStyle = 'caution'
} else {
$E3AvailableStyle = 'warning'
}
Output:
E3 greater than or equal to 25: 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment