Advertisement
wetyukmnbxc

Powershell 1of 3

Mar 16th, 2023
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. Sure! Here's an example of a simple PowerShell function that takes two inputs and returns one output:
  2.  
  3. ```PowerShell
  4. function Add-Numbers ($a, $b) {
  5. $sum = $a + $b
  6. return $sum
  7. }
  8. ```
  9.  
  10. This function takes two input parameters `$a` and `$b`, adds them together and assigns the result to the variable `$sum`. The `return` statement then outputs the value of `$sum`.
  11.  
  12. You can call this function like this: `Add-Numbers 3 5` and it will return `8`.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement