Built together

Share a script from an existing project

Already have a useful script in another repository or blog post? You do not need to start over or move the entire project. Bring the smallest complete example that helps someone solve the task.

Make a self-contained sample

  1. Make sure you have permission to share the code and assets under this repository's license. Preserve any required attribution.
  2. Fork and clone script-samples, then create a contribution branch.
  3. Use New-Sample.ps1 and the preparation guide to create a new folder under scripts, not samples.
  4. Adapt the script and its documentation. Include dependencies, tested tool versions, permissions, and a clear expected result. The sample should not depend on private files or your original repository being checked out.
  5. Add a source-credit section linking to the original project, and credit its authors in the README and gallery metadata.
  6. Replace private tenant details and credentials with safe placeholders. Add a warning before destructive operations and provide the gallery preview.
  7. Test the adapted sample and open a pull request.

If you use -KeepSourceCredit with the generator, it retains the template's example source-credit section. Replace its example link with your actual source before submitting.

Keep the contribution focused

Do not copy an entire repository, its dependencies, build output, or unrelated history into the gallery. If preserving Git history or including several interdependent files is important, discuss the approach with maintainers first.

When the sample is published, share its gallery link from the original project so readers can find the maintained example. Every sample contributor is eligible for the contributor badge.

Browse the gallery | Prepare a sample | Get GitHub help