标签: powershell powershell-v2.0
我有一个如下脚本:
param([parameter(mandatory=$true)][string]$sourceFolder) write-host $sourceFolder
如何为$sourceFolder参数提供默认值,使参数成为可选参数?
$sourceFolder
答案 0 :(得分:1)
DOH!刚想通了......
param([string]$sourceFolder = "1234")