I am running Unit Tests using ARM-TTK in Azure Devops and i have some selective unit tests that i would like to run from a desired location. The two location where i have my .JSON files are : ARM_Templates/IaaS and ARM_Templates/PaaS. I have other folders also that are present inside ARM_Templates parent folder but i don't want to include them in the test. So one of my task in the YAML pipeline is provided below :
- task: PowerShell@2
displayName: 'Run deploymentTemplate tests from ARM Template Tester Toolkit'
inputs:
condition: always()
targetType: 'inline'
script: |
cd D:\a\1\s\arm-template-toolkit\arm-ttk
Import-Module ./arm-ttk.psd1
get-childitem $(System.DefaultWorkingDirectory)/ArmTemplates.Templates/*.json | Test-AzTemplate -test "Resources Should Have Location","Location Should Not Be Hardcoded", "apiversions-should-be-recent"
pwsh: true
workingDirectory: '$(System.DefaultWorkingDirectory)/arm-template-toolkit/arm-ttk'
So how to specify the two different locations in the get-childitem cmdlet in the task so that ARM-TTK picks up the *.json files from both the folder locations