You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of the steps in this module are just simple PowerShell scripts. Writing and debugging a PowerShell script that's contained in a YAML file can be difficult, but they have to be kept in a YAML file to be used as a template.
What if each inline PowerShell script used in the templates had a PS1 file in a src directory, and when committing to the repo, a pipeline would "compile" each of those PS1 files inline into the relevant YAML file. A few of the scripts (right now the help steps) are just PowerShell scripts that write a powershell script do disk using a here-string and set-content, so maybe the source ps1 should be script to be written to disk rather than the script that writes the script do disk...
This would make it slightly easier to write/debug these scripts, and would introduce the ability to run some Pester tests against these PowerShell scripts.
Maybe the source directory structure would mirror the production structure, and the YAML files have some placeholder where a PowerShell script should be inserted and the build would do a find/replace (be mindful of indentation!) to insert the PowerShell script into the yaml, then commit it back into the repo (in a way that wouldn't trigger another build)
The text was updated successfully, but these errors were encountered:
A far out idea...
Most of the steps in this module are just simple PowerShell scripts. Writing and debugging a PowerShell script that's contained in a YAML file can be difficult, but they have to be kept in a YAML file to be used as a template.
What if each inline PowerShell script used in the templates had a PS1 file in a
src
directory, and when committing to the repo, a pipeline would "compile" each of those PS1 files inline into the relevant YAML file. A few of the scripts (right now the help steps) are just PowerShell scripts that write a powershell script do disk using a here-string and set-content, so maybe the source ps1 should be script to be written to disk rather than the script that writes the script do disk...This would make it slightly easier to write/debug these scripts, and would introduce the ability to run some Pester tests against these PowerShell scripts.
Maybe the source directory structure would mirror the production structure, and the YAML files have some placeholder where a PowerShell script should be inserted and the build would do a find/replace (be mindful of indentation!) to insert the PowerShell script into the yaml, then commit it back into the repo (in a way that wouldn't trigger another build)
The text was updated successfully, but these errors were encountered: