Add an additional switch to GeneratePermissions.ps1 that allows the user to toggle between generating scripts in a SSDT Post-Deploy format or a native Powershell format for use with other source control tools.
This will probably involve the following changes:
new parameter (-format = "ssdt", which could accept "ps", and potentially other options in the future)
Changing the code that generates the wrapper scripts to use invole-sqlcmd instead of ":r"
Changing the security wrapper scripts from a .sql to a .ps1
Update the security wrapper scripts to accept parameters for target database and server so they know where to deploy the security too.
update the security wrapper script to take a DeployType parameter, and pass this on to the sql scripts as a SQL env variable.
Add an additional switch to GeneratePermissions.ps1 that allows the user to toggle between generating scripts in a SSDT Post-Deploy format or a native Powershell format for use with other source control tools.
This will probably involve the following changes: