Page 1 of 1

cmdletbinding / compiled ps1

Posted: Tue Sep 21, 2021 5:06 am
by yves22
Hello,

Is there a way to keep the cmdletbinding when you compiled a ps1 script.

get-help [your_script.ps1] -full
can be
your_script.exe /?

I suppose that there is no way, but I hope there is one !

Sincerly yours

Re: cmdletbinding / compiled ps1

Posted: Tue Sep 21, 2021 7:22 am
by brittneyr
When a script is packaged as an executable, it no longer runs as a 'normal' script. You can add a parameter to your package script to show help. All functionality from cmdletbinding can also be handled.
You may find the following helpful:
https://www.sapien.com/blog/2015/11/30/ ... able-file/
https://www.sapien.com/blog/2015/12/07/ ... able-file/

Re: cmdletbinding / compiled ps1

Posted: Tue Sep 21, 2021 11:29 am
by yves22
thanks so much for this usefull and quick answer !!

Best regards,