$i = 1
$i++ + $i++ + ++$i + $i++ + $i = 16
1 + 2 + 4 + 4 + 5 = 16
[string]$name = "王亮"
[int]$tall = 172
[byte]$age = 22
[string]$project = "计算机"
[string]$school = "航天"
[string]$time = "2019年6月"
$name = ‘王亮‘
$tall = 172
$age = 22
$data = $env:path
echo("大家好,我的名字是{0},身高是{1},年龄是{2},我的电脑PATH变量包含有{3}" -f $name,$tall,$age,$data)
$x = $env:path
echo($x)
$index = $x.indexof("D:\app\Java\jdk1.8.0_241")
if($index -eq -1){
$x = $x + "D:\app\Java\jdk1.8.0_241"
echo($x)
}
$z = $env:JAVA_HOME
echo($z)
if($z -eq ""){
echo("为空")
$env:JAVA_HOME = "D:\app\Java\jdk1.8.0_241"
}else{
echo("有数值")
}
原文:https://www.cnblogs.com/kyooo/p/13166400.html