CByte
Definition: Returns an expression that has been converted to
a
Variantof subtype
Byte.
What do you mean, “Windows PowerShell is great and all, but there’s probably no way to convert a variable to the byte data type?" As it turns out, that's about as easy a conversion as you could hope to make. For example, the first of these two commands assigns a string value to the variable $a; the second command then converts $a to the byte data type (which, incidentally, consists of integers from 0 to 255):