Sorry, but I couldn't resist: Someone who does not know how to write "script" and never heard of preinstall and postinstall scripts should just read the basic info about adding and running scripts:
https://learn.jamf.com/en-US/bundle/jamf-pro-documentation-current/page/Scripts.html
Thanks for the speed response, i should also have stated i am new to JAMF and the last time i used a mac was Snow leopard , I am about 1/2 way done with the 100 course and learning as i go. i know script writing in powershell and some of that has helped but it slow going trying to locate things. i know my scripts work just can get them to show up in self service i will check out the 2 recommendation Thanks again
Forgive the slight offence, but before asking such basic questions, the manuals should be consulted first.
I know PowerShell can be used with Macs but I recommend using bash or zsh, which is native for Macs.
Depends on the package, application and what you are doing.
Keep in mind, Jamf runs any package it deploys unless you change the policy to cache the package. If you are needing to run a package with a script, you want to cache it rather than install it. You can then run the package with a command delivered however you want, most likely as a script payload in the same policy caching the package but run after. This way the package will cache, and the script will run the package. Then you just need to clean up the source files.
/usr/sbin/installer -pkg /Library/Application\\ Support/JAMF/Waiting\\ Room/something.pkg -target /
You can also repackage your package, and put a post install script in the package you made using composer. The post install script would look similar to the command above.
Again, this greatly depends on what you are doing any why.