I do not have access to this cmdlet, are you sure that it accepts a script block, not a string? If a string is required, try the following:
Get-User -Filter "SamAccountName -eq $SamAccountName"
If a script block attempt is actually required:
Get-User -Filter {SamAccountName -eq $SamAccountName}.GetNewClosure()
source
share