@Ijtehad Farooqui Thank you for posting your question!
I understand that you have requirement to automate azure migrate discovery & assessment using script. This link will not help with how to set up the appliance using PowerShell; however, you can find more info here Set up an Azure Migrate appliance with a script - Azure Migrate | Microsoft Learn
Also, check this PowerShell installer - https://learn.microsoft.com/en-us/azure/migrate/tutorial-discover-physical#2-download-the-installer-script
This script has the ability to install all 3 types of appliances, along with Private/Public endpoint setup.
I'd recommend looking at the script, and the documentation around it.
Update:
You can leverage this link - https://learn.microsoft.com/en-us/powershell/module/az.migrate/?view=azps-9.1.0, however, as I mentioned earlier, we cannot help in creating an entire script. If you need more info in this matter, you can file a support case for further assistance.
----------------------------------------------------------------------------------------------------------------------
If the response helped, do "Accept Answer" and up-vote it