我对使用 PowerShell 很陌生,想知道是否有人对尝试让 PowerShell 函数返回值有任何意见。
我想创建一些将返回值的函数:
Function Something
{
# Do a PowerShell cmd here: if the command succeeded, return true
# If not, then return false
}
然后有第二个函数,只有在上述函数为真时才会运行:
Function OnlyTrue
{
# Do a PowerShell cmd here...
}