Knowledgebase

Managing PowerShell Scripts Print

  • microsofttechnology, microsoft, woocommerce, ssl, password, errors, troubleshooting, guide
  • 0

Treating automation as code.

WHAT TO PUT IN VERSION CONTROL

Every script that matters.

WHY

They change, they break, and you need history.

WHAT TO INCLUDE IN EVERY SCRIPT

A description of purpose Parameter definitions with validation Examples Error handling Logging

WHAT TO ESTABLISH

A naming convention A shared location Who owns each script

WHAT TO AVOID

Scripts on individual machines Scripts nobody else understands Credentials in scripts

WHAT TO USE FOR CREDENTIALS

A secret store, or certificate-based authentication.

WHAT TO NEVER DO

Store passwords in a script file, in any form.

WHY

They are readable, and they end up in version control history.

WHAT TO BUILD FOR REUSED LOGIC

A module, rather than copying functions between scripts.

WHY

Copied logic diverges, and a fix applies to one copy only.

WHAT TO TEST

Scripts, ideally automatically.

WHAT TO REVIEW

Scripts before they are run against production.

WHAT TO RETIRE

Scripts nobody runs.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot