Reading from .sql file located in Visual Studio repository
0
votes
1
answer
222
views
A user.sql file which contains
USE [database]
GO
-- Legacy users cleanup
DROP USER IF EXISTS [dw];
etc...
is located at the repository: https://company.visualstudio.com/Database/_git/Azure?path=etc ...
I have a powershell script running on a VM that restores the database and I need it to remove users from the newly restored db using the above user.sql file.
Is there a way to access the file directly from the .ps1 script, read the code from it and execute it?
If not, what would be the steps to make it work?
Thanks and regards.
Asked by TheNixon
(371 rep)
Dec 9, 2022, 05:05 PM
Last activity: Jun 11, 2025, 11:05 PM
Last activity: Jun 11, 2025, 11:05 PM