Comments
3 comments
-
The code analysis should run as part of New-DatabaseReleaseArtifact (the PoSh cmdlet): https://documentation.red-gate.com/sca3/reference/powershell-cmdlets/new-databasereleaseartifactThe release report from this cmdlet contains the settings and warnings. Or are you looking for something more consummable programmatically like an XML result?
You can add in a settings file, some of which is described here: https://documentation.red-gate.com/sca3/automating-database-changes/code-analysis Rules get configured with Prompt and then a settings file saved that you can reference.
-
Thanks @way0utwest but I don't seems to be able to specify the correct parameters for the New-DatabaseReleaseArtifact commandlet. I was hoping to see an example of where I specify a connection to an existing database, a path for an output file that will contain the results of the code analysis and a path the the code analysis rules settings.
So, if my server is MyServer, database is MyDB, I want the code anaylsis results output to a file C:\CAResults.txt and the code analysis rules are in a file C:\CodeAnalysisSettings.casettings, what should my PowerShell command line look like?
-
The New-DatabaseReleaseArtifact takes an object that is a connection to a database. You would use New-DatabaseConnection to get that object. We don't use just parameters for many things, so you need to make a connection there. This returns an object.
The path for output files is a parameter for Export-DatabaseReleaseArtifact
https://documentation.red-gate.com/sca3/reference/powershell-cmdlets/new-databasereleaseartifact
https://documentation.red-gate.com/sca3/reference/powershell-cmdlets/new-databaseconnection
https://documentation.red-gate.com/sca3/reference/powershell-cmdlets/export-databasereleaseartifact
Add comment
Please sign in to leave a comment.
Can someone point me in the right direction please?