Script crash when terminal does not support color
When using the script to install all tools using ansible(winrm), the script crash without dowloading.
the exeption is cause because $defaultColor is $null
Cannot convert null to type "System.ConsoleColor" due to enumeration values that are not valid. Specify one of the following enumeration values and try again. The possible enumeration values are "Black;DarkBlue;DarkGreen;DarkCyan;DarkRed;DarkMagenta;DarkYellow;Gray;DarkGray;Blue;Green;Cyan;Red;Magenta;Yellow;White".
this si caused by following line (line 232) that could set TestColor to $null
https://github.com/EricZimmerman/Get-ZimmermanTools/blob/c40e8ddc8df5a210c5d9155194e602a81532f23d/Get-ZimmermanTools.ps1#L232-L240
to fix the issue, the condition (line 233) must be change by:
if ($TestColor -eq -1 -or $null -eq $TestColor )
@FormindAPE have you tested this?
FYI, I made a PR with this change so please advise when you can - https://github.com/EricZimmerman/Get-ZimmermanTools/pull/6
please let us know and if its working i can get it signed and deployed.
thanks
This works like a charm !!