在像
这样的示例函数中function get-foo
{
param ($name)
BEGIN {#I'm checking for something like $name being true/false}
PROCESS {#If $name is true I'll do something otherwise I want
to skip to END}
END {#last stuff}
}
是否有一个实际的cmdlet要跳到结束块,或者我只需要创建一个if语句来检查变量并将其包裹在我的PROCESS块内部?像这样,
function get-foo
{
param ($name)
BEGIN {#I'm checking for something like $name being true/false}
PROCESS {If ($name) {#If $name is true I'll do something otherwise I want to skip to END} }
END {#last stuff}
}