Introduction
Type casting changes a value from one type to another. It helps PowerShell understand how to treat the data.
When you get input as text but need a number to do math.
When you want to convert a number to text to show it nicely.
When you want to make sure a value is treated as a specific type before using it.
When reading data from files or user input that is always text but you need other types.
When you want to force PowerShell to store a value in a smaller or different type.