Home > Blockchain >  Creating variables in PowerShell scripts using New-Variable vs using assignment operator "=&quo
Creating variables in PowerShell scripts using New-Variable vs using assignment operator "=&quo

Time:09-28

What is the difference between using New-Variable and using the assignment operator "=" to create variables in PowerShell scripts?

e.g.

$var1 = "lalalala"

vs

New-Variable var1 "lalalala"

CodePudding user response:

New-Variable have additional parameters like description, constant which can be useful in some cases.

  • Related