To have two setups from a single AIP file, you can use the "multiple builds" support.
https://www.advancedinstaller.com/user-guide/tutorial-multiple-builds.html
You can group the files that you want included only in variant A of the product in a feature and then set that feature to only be part of the build A.
Similarly, you can only include a Custom Action in a specific build, so you can include the PowerShell script only in build B: