If you are dotnet developers and you wonder how to create your own cmdlets using c#. Here is the article Extend Windows PowerShell With Custom Commands
Example
Copy and Try it