We want to create custom item duplicate functionality just like OOTB Duplicate option provided by Sitecore.

Has anyone implemented such functionality using either powershell or .net code. How we can do it?