How to write a Powershell script to replace the specific word of a file and append the same to text file. RRS feed

  • Question

  • I have a txt file which has Database names in a single row. 

    I need to write a powershell script that inserts DB names in the text below and appends result to the text file looping everytime. 

    BACKUP DATABASE [Database_Name] TO  DISK = N'E:\TempBKP\Database_Name.bak' WITH NOFORMAT, NOINIT, 
     NAME = N'Database_Name-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10

    • Moved by Bill_Stewart Monday, January 7, 2019 8:14 PM Unanswerable drive-by question
    Monday, November 12, 2018 5:37 PM