concept type conversion in category powershell

appears as: type conversion, type conversions, type conversion
Windows PowerShell in Action, Third Edition

This is an excerpt from Manning's book Windows PowerShell in Action, Third Edition.

What else does the parameter binder do? It’s in charge of determining how to match the types of arguments to the types of parameters. Remember PowerShell is an object-based shell. Everything in PowerShell has a type. PowerShell uses a fairly complex type-conversion system to correctly put things together. When you type a command at the command line, you’re typing strings. What happens if the command requires a different type of object? The parameter binder uses the type converter to try to convert that string into the correct type for the parameter. If you use a value that can’t be converted to the correct type you get an error message explaining the type conversion failed. We discuss this in more detail in chapter 2 when we talk about types.

Type conversion is one of the areas of the PowerShell project that grew organically. The team sat down, wrote a slew of specifications, threw them out, and ended up doing something completely different. This is one of the joys of this type of work. Nice, clean theory falls apart when you put it in front of real people. The type-conversion algorithm as it exists today is the result of feedback from many of the early adopters both inside Microsoft as well as outside. The PowerShell community helped tremendously in this area.