Skip to content

Adding script template#164

Merged
silversword411 merged 3 commits intoamidaware:mainfrom
silversword411:main
Jul 2, 2023
Merged

Adding script template#164
silversword411 merged 3 commits intoamidaware:mainfrom
silversword411:main

Conversation

@silversword411
Copy link
Copy Markdown
Contributor

@NiceGuyIT Whatcha think about this for a template starter for PS...what other things might be missing?

@dinger1986
Copy link
Copy Markdown
Contributor

whys it got write-host and write-output? Whats the template to achieve? If its for someone to build scripts from then worth having it checking the event viewer and some other bits and pieces

@silversword411
Copy link
Copy Markdown
Contributor Author

silversword411 commented Jun 21, 2023

Whats the template to achieve

I've got so many little scripts with missing check-bits everywhere I'm really trying to have a "start with this" so it'll be a pattern to use for all scripts (and I'll be slowly updating the library to follow the standards)

https://docs.tacticalrmm.com/contributing_community_scripts/#good-habits
I'll be updating this as I go once this template has all the missing bits.

Not all the sections are needed for all scripts, but want a copy/paste for "standard" check stuff...where you can delete un-needed stuff. I keep forgetting which scripts have a good "do it this way for xyz task"

  1. RunAsUser...not always needed...but you need to make sure it's init'd if you're going to use it (can't use the native TRMM one when you have HKLM and HKCU registry entries to work with...for example)
  2. Making sure registry keys are there....setting reg keys with ps are a PITA, because if the keys don't exist, you're going to get an error, this simplifies. You have a function...just set all the key path and desired value and off she goes.
    etc.

@silversword411 silversword411 merged commit 5f3b745 into amidaware:main Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants