Quantcast
Channel: Active questions tagged return-value - Stack Overflow
Viewing all articles
Browse latest Browse all 210

PowerShell functions that return true/false

$
0
0

I am pretty new with using PowerShell and was wondering if anyone would have any input on trying to get PowerShell functions to return values.

I want to create some function that will return a value:

 Function Something {     # Do a PowerShell cmd here: if the command succeeded, return true     # If not, then return false }

Then have a second function that will only run if the above function is true:

 Function OnlyTrue {     # Do a PowerShell cmd here... }

Viewing all articles
Browse latest Browse all 210

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>