VBScript provides a number of specific functions to convert between data types including CStr(), CInt(), and CDate(). PowerShell uses a single operator, -as, to do the same thing:
$var = $var2 -as [string]
This example attempt to convert $var2 into a string and store the result in $var. Refer to Chapter 5 for more information on variables and types, and Appendix B for a more detailed list of the major types used in PowerShell.