Closed jeremymcgee73 closed 4 years ago
This is a PowerShell peculiarity, where the pipeline automatically uwraps object arrays. I forgot to fix this in my test script extension, but have it in my tests. You need to do the following:
$secret = $enc.GetBytes($string1)
...
if ($secret -is [byte[]])
{
return @(,$secret) # Return as array instead of individual array objects.
}
I'll update my test extension to do this.
When returning a bytearray in Get-Secret, only the first item of the array is returned. This should return the whole array to properly support ByteArrays. I worked on this for a few hours thinking it was my implementation. Then, I realized It was a bug. Thanks!
Steps to reproduce
Expected behavior
Actual behavior