G: cd "G:\tools\azcopy_windows_amd64_10.8.0" # Fetch tags from Azure Metadata $tags = Invoke-RestMethod -Headers @{Metadata="true"} ` -Uri "http://169.254.169.254/metadata/instance/compute/tagsList?api-version=2021-02-01" # Find the gdpr tag regardless of key case $gdprTag = $tags | Where-Object { $_.name -ieq "gdpr" } | Select-Object -ExpandProperty value -ErrorAction SilentlyContinue # Normalize value (only if tag exists) if ($null -ne $gdprTag) { $gdprValue = $gdprTag.Trim().ToLower() } else { $gdprValue = "" } # Determine GDPR flag if ($gdprValue -eq "true") { $gdprEnabled = $true } else { $gdprEnabled = $false } Write-Host "GDPR Enabled: $gdprEnabled" # Choose download URL if ($gdprEnabled) { Write-Host "Downloading Foreman from GDPR" & "G:\tools\azcopy_windows_amd64_10.8.0\azcopy.exe" copy ` "https://stagehyperexecutegdpr.blob.core.windows.net/ht-binaries/windows/hypertest-foreman.exe" ` "D:\foreman\hypertest-foreman.exe" --overwrite=true } else { Write-Host "Downloading Foreman from Non-GDPR" & "G:\tools\azcopy_windows_amd64_10.8.0\azcopy.exe" copy ` "https://hyperexecutestage.blob.core.windows.net/ht-binaries/windows/hypertest-foreman.exe" ` "D:\foreman\hypertest-foreman.exe" --overwrite=true }