I want to verify the database for the given script in CI. I want to check specific string exists or not in the given file.
Below is the content of my file
USE [SampleDB]
I am reading the content of my file and checking [SampleDB] string exists or not in the file.
I have tried the below things.
If(Get-Content -path D:/Document/admin.sql | Select-String -Pattern "[SampleDB]")
{
# Right Database exist
} else {
# Right Database does not exist
}
How can I verify the right database name after the USE string?