-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
When the function New-RedactionRule is typed in interactive console without new value parameter (NewValueFunction or NewValueString) the user is prompted for an input to parameter NewValueFunction which is a [ScriptBlock]. For every given value an error is thrown as this request cannot be fulfilled.
ps> New-RedactionRule -Pattern 'a'
cmdlet New-RedactionRule at command pipeline position 1
Supply values for the following parameters:
NewValueFunction: b
New-RedactionRule : Cannot process argument transformation on parameter 'NewValueFunction'. Cannot convert the "b" value of type "System.String" to type "System.Management.Automation.ScriptBlock".
At line:1 char:1
+ New-RedactionRule -Pattern 'a'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [New-RedactionRule], ParameterBindingArgumentTransformationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,New-RedactionRule
The preferred behavior would be to get a string value instead of [ScriptBlock] which is impossible to provide to a console prompt (to my knowledge).
The reason for the current behavior is that the default parameter set is set to 'Function' and the parameter NewValueFunction is belong to that parameter set.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working