learning-notes

Mainly used to record Java, DBMS, HDFS... related learning notes

View the Project on GitHub zhangymPerson/learning-notes

powershell脚本

powershell 不需要显示地去声明,可以自动创建变量,只须记住变量的前缀为$.

#定义变量
$a=10
$b=4
#计算变量
$result=$a*$b
$msg="保存文本"

#输出变量
$result
$msg

创建好了变量后,可以通过变量名输出变量,也可以把变量名存在字符串中。但是有个例外单引号中的字符串不会识别和处理变量名。