Template how a SSDT project can be setup including tSQLt
To use this template you need the PSModuleDevelopment module which is part of the PSFramework project
Use the following command to create a new template from this directory
New-PSMDTemplate -ReferencePath [pathtofolder] -TemplateName [nameoftemplate]i.e.
New-PSMDTemplate -ReferencePath C:\Users\sande\source\repos\Databases\SSDT-With-tSQLt-Template -TemplateName SSDTWithtSQLtTo create a new solution from the template use the following command
Invoke-PSMDTemplate -TemplateName [nameoftemplate] -OutPath [path-to-output-to] -Name [nameofproject]i.e.
Invoke-PSMDTemplate -TemplateName SSDTWithtSQLt -OutPath C:\Users\sande\source\repos\Databases -Name DatabaseProject1For more guidance on the template system, visit the documentation pages for the module
Look for the functionality to create basic tSQLt unit tests for this solution to the module "PStSQLtTestGenerator".
To install for everyone
Install-Module PStSQLtTestGeneratorTo install for current user
Install-Module PStSQLtTestGenerator -Scope CurrentUserTo create the unit tests
Invoke-PSTGTestGenerator -SqlInstance [yourinstance] -Database [yourdatabase] -OutputPath [path to SSDT project test folder]