Azure Pipeline PowerShell SQL Script
Hello all –
I am hoping to get some help in understanding what I need to do in order to be able to execute a PowerShell script from a release pipeline that executes .sql files in my DevOps repository. We have created a deployment group which includes an agent being set up on our server.
I am able to connect to the SQL Server via my PowerShell script, but I am not able to execute anything in my repository.
How do I reference a specific .sql file that I have stored in a repository? I would like to use it in my command that I am trying to use in my PowerShell script:
Invoke-SqlCmd -ServerInstance “MyServerInstance” -Database “MyDB” -InputFile ???
I have tried using $System.DefaultWorkingDirectory but that just references a folder on the server. What do I need to put into the ??? placeholder?
Thank you in advance
Hello all – I am hoping to get some help in understanding what I need to do in order to be able to execute a PowerShell script from a release pipeline that executes .sql files in my DevOps repository. We have created a deployment group which includes an agent being set up on our server. I am able to connect to the SQL Server via my PowerShell script, but I am not able to execute anything in my repository. How do I reference a specific .sql file that I have stored in a repository? I would like to use it in my command that I am trying to use in my PowerShell script: Invoke-SqlCmd -ServerInstance “MyServerInstance” -Database “MyDB” -InputFile ??? I have tried using $System.DefaultWorkingDirectory but that just references a folder on the server. What do I need to put into the ??? placeholder? Thank you in advance Read More