maester icon indicating copy to clipboard operation
maester copied to clipboard

Provide non-interactive parameter to Install-MaesterTests

Open jaoenrong opened this issue 1 year ago • 3 comments

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?

jaoenrong avatar Aug 05 '24 20:08 jaoenrong

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.

merill avatar Aug 13 '24 06:08 merill

I ended up performing the delete instead of carrying forward multiple copies of tests. Can the documentation be updated to reflect that?

jaoenrong avatar Aug 20 '24 20:08 jaoenrong

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.

merill avatar Aug 27 '24 11:08 merill