Advertisement
wetyukmnbxc

Powershell 2 of 3

Mar 16th, 2023
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. Sure! Here's another example of a simple PowerShell function that takes two inputs and returns one output:
  2.  
  3. ```PowerShell
  4. function Get-FullName ($firstName, $lastName) {
  5. $fullName = "$firstName $lastName"
  6. return $fullName
  7. }
  8. ```
  9.  
  10. This function takes two input parameters `$firstName` and `$lastName`, concatenates them with a space in between and assigns the result to the variable `$fullName`. The `return` statement then outputs the value of `$fullName`.
  11.  
  12. You can call this function like this: `Get-FullName "John" "Doe"` and it will return `"John Doe"`.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement