Monday, 11 April 2011

Testing if a variable is a specific type in Powershell

if ($variable -is [int]) {
  write-host "the variable is an integer
}


Found on http://www.computerperformance.co.uk/powershell/powershell_syntax.htm under Powershell Operators

No comments:

Post a Comment