I’m not following the code very easily to understand the goal really. Typically I’d suggest providing output as well, and then the expected output you desire.
However if the parameter $return is the hashtable, try casting [Systems.Collections.HashTable] or just [HashTable] instead:
param (
[Parameter()]
[Hashtable]
$return
)
Casting [String] to a hashtable is basically going to invoke the ToString method on it, resulting in a string output.
the code was get the every noteobject in the parameter and filter the value of hashtable and list the value of the hashtable
and i manage to do it with code