Intune Configuration as Code - save script JSON output files to Azure DevOps in a specific folder
Hi,
Fairly new to the DevOps scene. I currently got a script in my devops repo that will export all configuration profiles from a tenant and output to JSON files using the following method (just part of the script):
$configurationPolicy | ConvertTo-Json -Depth 100 | Out-File -LiteralPath ".\$fileName.json"
I'm triggering this script from a pipeline. So far so good, script executes fine. However, I'm noticing that the JSON files are being stored on the machine that's hosting the agent (either Microsoft hosted, or self-hosted) on the "agent\_work\2\s" folder. However, I want these files to be stored into my DevOps repo in a specific folder and not on a place which I cannot reach.
So far I haven't managed to find a method to reach this outcome. Is this possible or not, and if so, how should this be done?
Thanks!