Provide non-interactive parameter to Install-MaesterTests
When running the process as mentioned in the Azure Automation guide, part of the scheduled runbook under the automation account managed identity is to run 'Install-MaesterTests'. This command is interactive if it finds existing files and hangs the runbook.
A non-interactive prompt to auto handle existing files to either delete what is there or cancel out of the command.
The prompt "Do you want to continue with this folder? (y/n):" does not show up by default in the runbook output. There does not appear to be a timeout counter so the job will sit until something extraneous kills the process.
Question: how regularly should Install-MaesterTests be run, every time we run the scan, or less often?
You can run these once a week.
We really want to be safe and avoid overwriting any existing content.
You have two options. Specify a different folder for each run e.g using Get-Date as part of the folder name to export to.
Alternatively perform the delete in your script before running Maester.
I ended up performing the delete instead of carrying forward multiple copies of tests. Can the documentation be updated to reflect that?
Good idea. Would love it if you could submit a PR since you have a tested working version of the code?
Maybe include it under a new heading on the page that calls out how to clear previous runs in Azure Automation.