Add parameter validation functions and enhance tests for configuration data
This commit is contained in:
20
Private/Test-ConfigurationDataValueIsInteger.ps1
Normal file
20
Private/Test-ConfigurationDataValueIsInteger.ps1
Normal file
@@ -0,0 +1,20 @@
|
||||
function Test-ConfigurationDataValueIsInteger {
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[AllowNull()]
|
||||
$Value
|
||||
)
|
||||
|
||||
if($null -eq $Value -or $Value -is [bool]){
|
||||
return $false
|
||||
}
|
||||
|
||||
return ($Value -is [byte]) -or
|
||||
($Value -is [sbyte]) -or
|
||||
($Value -is [int16]) -or
|
||||
($Value -is [uint16]) -or
|
||||
($Value -is [int]) -or
|
||||
($Value -is [uint32]) -or
|
||||
($Value -is [long]) -or
|
||||
($Value -is [uint64])
|
||||
}
|
||||
Reference in New Issue
Block a user