Showing results for 
Search instead for 
Did you mean: 
Kudo Collector
Kudo Collector

Command Line failing with error "Cmd.exe exited with code 1" after Unpack in Command Line in Pipeline


I've been trying to export Solution from an environment and trying to import in another on in same tenant. In the first half of the process where we usually go with - Tool Installer -> Export Solution -> Unpack Solution -> Command Line Script.

My Job is failing in Command Line Script which looks like this

echo Write your commands here

echo commit all changes
git config ""
git config "Joe Danny"
git checkout master
git add --all
git commit -m "solution export"
echo push code to new repo
push origin master


I also don't see if my solution was actually exported. The Export Step though was successful.

I'm not using MFA, but I'm not sure if this is correct and where I can find documentation on this. I simply tried to do referring other's articles. Please point me in the correct direction.


Community Support
Community Support

Hi @priyeshwagh777 ,


could you let me know from where you are attempting to export your solution from? If you are attempting to export a solution from Power Platform and are using PowerApps, you can simply go to, and you can import it directly from the solutions tab:





Hope this helps!





I'm doing this by using Power App Build Tools in Azure DevOps under PipeLines to automate my CI/CD process.

Greetings, sorry this thread has been quiet - can you pls. try and remove the following line from your script: "echo Write your commands here"


MFA is unrelated to this as your solution exports correctly, i.e. you are connected to the environment. Let me know if that helps




New Member


Was anybody able to solve this issue? I am getting the same error, tried removing the echo statements, then too failing

Super User
Super User

Hi @prik20 , 

I have the feeling that this is an error caused if in the agent job properties, the "Allow scripts to access the OAuth token" is missing.




Hope this helps!

Kind regards,


Kind regards,
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Frequent Visitor

Ok I had the exact same problem as stated above, and not sure if you figured it out already, but this is what worked for me.

First- Verify the name of your primary repository branch, code from elsewhere calls it "master" but mine was actually called "main".
So I changed the code to :

echo commit all changes
git config ""
git config "<username>"
git checkout main
git add --all
git commit -m "solution init"
echo push code to new repo
git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" push origin main


Then I also had to make sure that the repository had the right permissions.


So I went to Project Settings>Repositories Clicked on my repository for settings


Then I went to Security and updated the Build Service User as well as my own login with permissions to write, push, and create in the repository.


I also updated the permissions on all other repositories for future pipelines.





After that, it worked.



Wanted to say thank you and much appreciated! This resolved the problem for me. 👍👍

Thanks for sharing the solution, I also had the same problem and was able to solve it!

Helpful resources

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Users online (1,942)