PoshCode / Pansies

Powershell ANSI Escape Sequences, functions for colored output, etc.
MIT License
146 stars 14 forks source link

Use non-throwing alternative to $stepSize | Get-Member H #14

Closed powercode closed 3 years ago

powercode commented 5 years ago

In https://github.com/PoshCode/Pansies/blob/59a1a5c2a1ea4f39314baa2cdd13c4899fcc2f57/Source/Public/Get-Gradient.ps1#L47, throws an exception:

Cannot convert value "System.Management.Automation.PSCustomObject" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0

I suggest using a test like

[bool]$RotatingColor = $ColorSpace -in 'LCH', 'HSL', 'HSV', 'HSB'

or

[bool]$RotatingColor = $null -ne $StepSize.H
Jaykul commented 3 years ago

This is obviously gone with the rewrite to C#