How to define a variable in PowerShell?

You can use dollar ($) sign to assign a variable name in PowerShell. For example suppose you want to define a new variable named myvar, then use $myvar. If you want to assign a value to the variable, then $<variable_name> = <variable_value>. Please find below quick reference –

Leave a Reply