我对使用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...
}