1) Passing hash tables (or any instance of classes, that is, reference types) using [ref] does not make sense, since they are always passed by reference themselves. [ref] used with type values ββ(scalars and instances of structures).
2) The splatting operator can be applied to a variable directly, and not to an expression.
Thus, to solve the problem, just pass the hash table in the function as it is:
Function AllMyChildren { param ( [hashtable]$ReferenceToHash
source share