sfdx force:mdapi:retrieve -s -r ./mdapipkg -u myemail@email.com -p 'My Package'

'C:\Program' is not recognized as an internal or external command, operable program or batch file.


sfdx force:mdapi:retrieve -s -r ./mdapipkg -u myemail@email.com -p 'MyPackage'

doesn't give this error, it just says:

The metadata retrieve operation failed: INVALID_CROSS_REFERENCE_KEY: No package named 'MyPackage' found.

  • Don't have a windows computer to test it on, but try the ^ symbol. Supposedly it escapes the spaces, not sure if it'll work through a command. Jul 18 '18 at 19:28
  • no such luck, it just weird.
    – jeremiah
    Jul 18 '18 at 19:39
  • According to any documentation I can find, enclosing the string with '' should work, ie: $ sfdx force:package2:create -n PackageName -d 'My New Package' -o Unlocked. Might be worth going to the sfdx community & reporting this as a bug. Jul 18 '18 at 20:00
  • Have you tried with a package that actually doesn't contain a space, just to test? Also, using CMD or PowerShell?
    – pchittum
    Jul 20 '18 at 6:39

Turns out the reason it wasn't working was due to the production site not being a development hub anymore. Higher ups made changes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.