function test([string]$word){
return $word
}
Get-ADUser -Identity Function:\test("bill")
From what I can tell the above should work. MS has an example below where it looks like they call a function as a parameter. But its not working for me.
MS example.
Get-ChildItem -Path Function:\Get-*Version | Remove-Item
Link - https://learn.microsoft.com/en-us/powershell/scripting/learn/ps101/09-functions?view=powershell-7.1