有人可以帮助我,因为我在第一种方法执行休息后无法调用第二种方法。
Function First ()
{
write-host "I am in First method"
break;
}
Function Second ()
{
write-host "I am in second method"
}
First
Second
答案 0 :(得分:0)
我建议不要使用*-Host
函数,除非出于特殊原因需要它们,并使用经批准的动词 - 名词命名约定(Get-Verb
)。 break
是一个关键字,旨在打破摆脱循环(foreach
,for
,while
等。)
重新写为:
Function Get-First
{
'I am the First function.'
# equivalent to: Write-Output 'I am the First function.'
}
Function Get-Second
{
'I am the Second function.'
}
Get-First
Get-Second