How can I debug a commandlet?

Is there a way to debug a commandlet? I can run a commandlet from a separate cmd window. But I don’t know how can I run a commandlet from visual studio?

Finally I found this solution.…-a-commandlet/
Hope this can help people who are new to ue4.