parameter-splatting Questions

2

Solved

Consider the following simple function: function Write-HostIfNotVerbose() { if ($VerbosePreference -eq 'SilentlyContinue') { Write-Host @args } } And it works fine: Now I want to make it an a...
Sternforemost asked 10/2, 2022 at 22:7

2

Solved

I downloaded the npm package for merge junit reports - https://www.npmjs.com/package/junit-merge. The problem is that I have multiple files to merge and I am trying to use string variable to hold ...
Ordeal asked 27/11, 2019 at 12:8

1

Solved

In PowerShell you can create a hashtable and add this hashtable to your function with an @, which is splatting in PowerShell. $dict = @{param1 = 'test'; param2 = 12} Get-Info @dict Can one pass...
Ascham asked 29/3, 2020 at 15:23

2

Solved

If you have multiple parameters which require a value when calling a command or a script, I know you can pass it like this: $parameters = @{ name = "John" last_name = "Doe" } But if the comman...
1

© 2022 - 2024 — McMap. All rights reserved.