0
我的PowerShell腳本具有以下結構PowerShell的新手打破了腳本具有多種功能
[CmdletBinding()]param()
process{
# call function a
# call function b
}
end{}
Function a{
[CmdletBinding()]param()
process{}
}
Function b{
[CmdletBinding()]param()
process{}
}
上述結構拋出一個錯誤,告訴我,
Unexpected token 'Function' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : UnexpectedToken
這是我的第一個PowerShell腳本
任何幫助真誠讚賞
謝謝
當你執行' Begin-Process-End'在一個函數中,你不能在外面放置代碼* *這三個塊。將你的內部函數放在'begin'塊中 –