Skip to content

elifry/powershell-automation-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Powershell Automation Examples

Tests Status

Powershell (7+) kick-starting material for automation, written with a lot of structure in place.

All examples are multi-platform, unless otherwise stated.

Example 1: Generate a Markdown Analytics Report from API Calls

Generates a sample markdown file and opens it for you in VSCode.

Context: use API calls to gather data and create a report in markdown. No use of local repos. Uses a local env file for secrets.

TODO:

  • Make use of the cache folder and use cache loading

It will look something like this:

Example 1

Structure

  • 📂/scripts/
    • 📂/analytics/
    • 📂/cache/ (generated folder - ignored by git) - Holds the API data as a cache
    • 📂/general-utilities/
    • 📂/markdown-snippets/
    • 📂/output/ (generated folder - ignored by git) - Where the results file goes
      • api-results.md - Output markdown file
    • 📂/test-analytics/
    • 📂/test-groups/
    • analyze-api-items.ps1 - Starting point. Does setup, does analysis, and shows results

How to run

Run the "Example 1" Run and Debug action in VSCode. Alternatively, you can run the scripts/analyze-api-items.ps1 script directly in powershell.

All Tests

Note: Each example runs all tests for components used in that example, with overlap because they use common components. "Run All Tests/test-all" will only run each test once, without overlap.


Created by Elijah Fry, License MIT.

About

Powershell Automation Examples

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published