I have a 2 folded issue. I have a file in my sites that contains info such as Database. I am trying to use that information to create a script that will look to the file, grab the db name and then input it into a script to do a DB backup on that database.
I am new to powershell but have found Select-String:
Select-String -Path \server\d$\path\init.asp -Pattern “USERDB =”
The result is:
\vs25\d$\path\init.asp:12: USERDB = “DB_name”
I just need to grab the DB_name, no quotes, and then place that into a script to backup said DB.
Any help would be greatly appreciated.