Get details and creators of all Salesforce reports that reference a specified field

If you’re ever modifying a Salesforce field and you want to contact everyone who has created reports using the field, here’s how you do that using Powershell and the CLI (which you can also install via chocolatey):

set-location C:\wherever
force export
$reportFiles = get-childitem -Path .\src\reports\ -Recurse | sls “field_to_search_for"

# I’ve included some extra fields here, they might come in useful
$reportData = force query –format=json “select id,,, developername, name, foldername, isdeleted, lastrundate, lastvieweddate from report” | convertfrom-json
$matchingReports = $reportData | where { $reportFiles.Filename -eq $_.DeveloperName + “.report” }

$matchingReports | % { $ + ' created report “’ + $ +’"’ }
# send an email to these folks: $ | select -Unique