Categories

Scripting Games–integer parameters

I keep seeing paramter constructs like this:

[int]$age = '90'

Why set the parameter to an integer and then set the default as a string.  PowerShell will convert but it just doesn’t make sense.

All you need is

[int]$age = 90

Leave a Reply