Pop the function into your file where you keep your shell functions. Then run source <shell function file>
to reload it into the shell.
Now you're all set:
$ kubectl-secrets -n foobar secret-sauce
{
"name": "secret-sauce",
"data": {
"ADMIN_PASSWORD": "53O...vg==",
"ADMIN_USERNAME": "admin"
}
}