Skip to content

Instantly share code, notes, and snippets.

@Szandor72
Last active October 3, 2017 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Szandor72/4fc4d5b15f4f9e92742ac6bae2fcde3e to your computer and use it in GitHub Desktop.
Save Szandor72/4fc4d5b15f4f9e92742ac6bae2fcde3e to your computer and use it in GitHub Desktop.
ForceCode: Generate and set Credentials for Scratch Orgs (Powershell)
sfdx force:user:password:generate
$myOrg = (sfdx force:org:display --json | ConvertFrom-Json).result
$forceConfig = Get-Content .\force.json -Raw | ConvertFrom-Json
$forceConfig.url = $myOrg.instanceUrl
$forceConfig.username = $myOrg.username
$forceConfig.password = $myOrg.password
$forceConfig.apiVersion = "40.0"
$forceConfig | ConvertTo-Json | Out-File -FilePath force.json -Encoding utf8
@celador
Copy link

celador commented Oct 3, 2017

very nice! I'll look into integrating this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment