Variables are an integral part of how PowerShell works
Variables are a fundamental part of Windows PowerShell. They’re quite different from the variables in Cmd.exe. In Cmd.exe, all variables are environment variables, which you primarily access with the Set command. The environment variables can store only strings of text. (You can store a number in an environment variable, but it’s up to the program that’s reading the environment variable to interpret it as a number.)
The variables in PowerShell aren’t environment variables but rather native PowerShell variables. They can store much more than just text. In fact, PowerShell variables store objects (specifically, Microsoft .NET Framework objects). For example, a PowerShell variable can contain a String object or a number object, such as an Int (integer) object. Objects provide an extraordinary amount of flexibility.
Click here for more with examples