POWERSHELL中的{} “” ‘’是什么作用


PowerShell交流中心分类: Powershell基础POWERSHELL中的{} “” ‘’是什么作用
0
菠萝小草莓 asked 6 年 ago

POWERSHELL中的{} “” ‘’是什么作用

1 Answers
0
Best Answer
Mooser Lee 管理员 answered 6 年 ago
# {} 定义脚本块 #
$script = {
Get-Date
}
& $script
# 双引号和单引号都可以字符串
# 唯一的区别,双引号中的变量会被替换成值
$blog = 'pstips.net'
"blog url:$blog"
'blog url:$blog'
blog url:pstips.net
blog url:$blog