Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PS C:\> Function Test-Array {
- Param (
- [parameter(Mandatory=$true)]
- [ValidateSet('a','b')]
- [System.Collections.ArrayList]$Letters = @()
- )
- $letters
- }
- Test-Array -Letters a
- Test-Array : Cannot process argument transformation on parameter 'Letters'. Cannot convert the "a" value of type
- "System.String" to type "System.Collections.ArrayList".
- At line:11 char:21
- + Test-Array -Letters a
- + ~
- + CategoryInfo : InvalidData: (:) [Test-Array], ParameterBindingArgumentTransformationException
- + FullyQualifiedErrorId : ParameterArgumentTransformationError,Test-Array
Advertisement
Add Comment
Please, Sign In to add comment