Test IsNumericType - dsccommunity/DscResource.Common GitHub Wiki
Returns whether the specified object is of a numeric type.
Test-IsNumericType [[-Object] <Object>] [<CommonParameters>]
Returns whether the specified object is of a numeric type:
- [System.Byte]
- [System.Int16]
- [System.Int32]
- [System.Int64]
- [System.SByte]
- [System.UInt16]
- [System.UInt32]
- [System.UInt64]
- [System.Decimal]
- [System.Double]
- [System.Single]
Test-IsNumericType -Object ([System.UInt32] 1)
Returns $true
since the object passed is of a numeric type.
([System.String] 'a') | Test-IsNumericType
Returns $false
since the value is not a numeric type.
('a', 2, 'b') | Test-IsNumericType
Returns $true
since one of the values in the array is of a numeric type.
The object to test if it is a numeric type.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
When passing in an array of values from the pipeline, the command will return $true if any of the values in the array is numeric.