microsoft / EntraExporter

PowerShell module to export a local copy of an Entra (Azure AD) tenant configuration.
https://aka.ms/EntraExporter
MIT License
568 stars 89 forks source link

Question: Why do you recommend emptying the destination folder before running the export? #32

Closed SamErde closed 1 year ago

SamErde commented 2 years ago

I'm curious about the step on line 191 of the readme that removes all items in the target export folder:

$tenantPath = './<tenant export path>'
$tenantId = '<tenant id>'
Write-Host 'git checkout main...'
git config --global core.longpaths true #needed for Windows
git checkout main

Write-Host 'Clean git folder...'
Remove-Item $tenantPath -Force -Recurse

Is the purpose of this to start with a clean slate, or is it required to prevent issues with git?

merill commented 1 year ago

Correct, if items are deleted in the cloud we would have left over items from the previous run being commited.

SamErde commented 1 year ago

Thanks, that makes sense!