@胜 邢 Thank you for contacting us. Unfortunately, there isn't a command-line approach available to join the device to Entra ID at the moment. The steps you followed is the only method to join the device to Entra ID.
You can share your feedback for this feature request - https://feedback.azure.com/d365community/search/?q=powershell+azure+join
Reference QnA post - https://learn.microsoft.com/en-us/answers/questions/1610955/error-computer-pc-1-failed-to-join-domain
Let me know if you have any further questions, feel free to post back.
Please remember to "Accept Answer" if answer helped, so that others in the community facing similar issues can easily find the solution.