Compare Salesforce environments
The problem: a release works in UAT but not in production, and you suspect the fields have drifted apart.
PS> Compare-SalesforceFields -SourceOrg uat -TargetOrg prod -ObjectName Account, Opportunity |
Format-Table ObjectName, FieldName, Difference, Property, SourceValue, TargetValue
ObjectName FieldName Difference Property SourceValue TargetValue
---------- --------- ---------- -------- ----------- -----------
Account Customer_Tier__c Changed PicklistValues ["Gold","Platinum","Silver"] ["Gold","Silver"]
Account Region__c MissingInTarget Type picklist
Opportunity Discount_Percent__c Changed Precision 5 3
Opportunity Partner_Code__c Changed Length 20 10
Opportunity Partner_Code__c Changed Nillable true falseIllustrative output from made-up orgs. Its shape and formatting are what the command returns.
One row per difference: fields missing from either org, and each changed property with both values. It only reads the orgs. With the CLI alone you would run sf sobject describe for each object in each org, then match the fields and compare the properties in your own script. See Compare-SalesforceFields, Compare-SalesforcePermissions and Compare-SalesforceMetadata.
