It’s a scope problem. The dashboard is in its own scope so the function is not declared there. To solve your issue you have to move Your Test-it function in the dashboard scriptblock