You can use Nifi-Toolkit which provides CLI to interact with NIFI instance and NIFI Registry instance.
A Powershell script can than be written to automate the whole deployment process.
You need to register registry clients to you Nifi instance. Once you create the appropriate buckets per your environment in your registry instance and connect this instance to your Nifi flows, you can use Nifi toolkit which provides commands to export flow from one environment and import it to other via registry buckets.
e.g. run the following command from the Cli.sh or cli.bat which is found in nifi-toolkit code base.
registry export-flow-version -f $fromFlowidentifier -fv $flowversion -o temp-flow.json -ot json -u $registrylink ;
here fromflowidentifier is the flow identifier that is found in your registry bucket. temp.json is the file where it will export the flow. Once exported you can import the flow using bellow command.
registry import-flow-version -f $toflowidentifier -i temp-flow.json -u $registrylink ;
Here it is assumed you have linked the nifi instances with the buckets in registryclient .
Here is my sample autodeployment powershell script to import nifi flow: It will not only deploy the flow but will also set the flow variables. If deployment fails for some reason it will also send an email. This assume you are using Nifi-registry and have installed Nifi-toolkit. Please go through the readme and script is also commented for proper understanding.
Here is the example powershell script: https://anp8729.github.io/Nifi_AutoDeploymentScript/