Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[CmdletBinding()]
param
(
[Parameter(Mandatory = $True,
ValueFromPipeline = $True,
ValueFromPipelineByPropertyName = $True)]
[string[]]$AssetTag
)
BEGIN {
@corbob
corbob / why.ps1
Created March 10, 2018 23:20
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 {