While working with a customer and provisioning Search they were getting a strange error that was causing the topology not to activate. It just stayed in a hanging state and in the Windows Application log there were errors: Event ID 2548 – "Content plugin can not be initialized – list of CSS addresses." After a little research and testing I figured out the problem was really easy to fix. We granted the WSS_WPG and WSS_Admin_WPG groups Full Control permissions to the path where the Search Index would live. After we made the change the topology activation finished without issues. We did a quick reboot and the server came back up without errors.
As for the script used to provision search, see this post.