脚本 d:dot.ps1 内容如下:
$hostwrite-host "hh"$m="pp"$a ="cc"
通过 . 方式运行脚本 dot.sp1,如下:
. d:dot.ps1
之后,脚本 dot.ps1中的变量 $m,$a都可以继续使用