Link to home
Get AccessLog in
Avatar of Kelly Garcia
Kelly GarciaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Powershell parameters

Hi,

I have the this following parameter in my parameters section:

param(
[string]$workspacerg=$null,
[string]$SelectedSubscription=$null,

)

Open in new window


how do i only enable one value on bothe these parameters, i dont want the user to be able to send multiple values
Avatar of sirbounty
sirbounty
Flag of United States of America image

Are you trying to prevent them from using both parameters? If so I think a parameter set is why you need but please confirm.
how do i only enable one value on bothe these parameters, i dont want the user to be able to send multiple values

param(
[string]$workspacerg=$null,
[string]$SelectedSubscription=$null,
)

if ($workspacerg -ne $null -and $SelectedSubscription -ne $null)
{
    # Only specify one error
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Brent Challis
Brent Challis
Flag of Australia image

Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access