Google News
logo
PowerShell - Interview Questions
How to declare and create a variable in PowerShell?
Declaration : In PowerShell, you can declare a variable by using the $ (dollar) sign at the beginning of the variable name. Following syntax describes how to declare the variable :
$ <variable_name>
For example : $var
 
Creation or Initialization : In PowerShell, you can create a variable by assigning the value to a variable using the assignment operator. Following syntax describes how to declare the variable :
$ <variable_name> = <value>
Advertisement