I wrote a function with four parameters. The first two parameters are mandatory for both sets : Payload and Algorithm. The last two parameters (Secret ...
I wrote a function with four parameters. The first two parameters are mandatory for both sets : Payload and Algorithm. The last two parameters (Secret ...
I have the following snippet of a functions parameters and their sets function Test { [CmdletBinding(DefaultParameterSetName='StringConsole')] ...
Consider these parameters: UserId & EmployeeId are mutually exclusive GroupId & GroupName are mutually exclusive All of them are ma ...
I have written a function which uses four parameters, and four parameter sets. The first parameter, $Path, is unassigned to a set, and therefore belon ...
I have a function that have this parameters: i'm trying to acomplish the following: When i call -SendMail NO parameter is mandatory When i call -U ...
I'm struggling to understand the behavior of parameter sets and positional binding. Here is the sample function. Based on the help output it would ...
I wrote a powershell script with some parameters but I can't figured out how to get the syntax like script.ps1 [A|B] C [D] script.ps1 [A|B] C E F s ...
I want to make all parameters in a parameterset mandatory, but only if one of the parameters is actually specified (all or none situation). So i want ...
I have a powershell script with rather long parameter sets: I have tested the functionality of these parameters according to my needs and it works ...
Up till now I was more or less avoiding parameter-sets in my PowerShell script as I find them very verbose and quiet difficult to implement for comple ...
Question: Looking to either change the error message displayed to say they need the '-passed, -warning, or -failed' to be included with the cmdlet par ...
Original Question - Update below - Final code in marked answer More or less a simple question I hope but my brain is fried. I'm trying to write a mod ...
I'm working on a function that compares two objects so it detects them if they are identical. However I would like it to also work with other types li ...
I need to get three parameters for a function that I am creating. Parameter one must be in all parameter sets. The other two parameters has multiple p ...
I am trying to call a PowerShell function that has a parameter set, using another PowerShell function with a parameter set. In the code below, I want ...
I'm trying to figure out which method would work best for the following situation. Example function: If (Test-Path -Path $PSScriptRoot\APICredenti ...
I'm trying to make a parameter mandatory, but only if another parameter uses certain ValidateSet values. It seems that using a code block on Mandatory ...
I'm trying to use Parameter Sets to replicate this functionality: Simple example of what I have so far: This is not working. I can supply $hostN ...
I'm seeing some strange behavior in a custom function I've written, and so I wrote some quick test functions with different characteristics to exhibit ...
Say you have and old, deprecated parameter set, and a new parameter set: I want both parameter sets to continue working, to preserve compatibility ...