I'm trying to run a script using the following:
invoke-sqlcmd -serverinstance PC01 -database DEV -inputfile "D:\BuildDatabase.sql" -verbose | out-file -filepath "D:\SqlLog.txt"
The script generates an error (in red), as well as some print statements (in yellow), that are displayed on the powershell console when run. However, no output is written to the log file.
The SqlLog file is created successfully, but it is empty.
The messages I want to put into the file are displayed on the console screen. I just can't get them there.
invoke-sqlcmd -serverinstance PC01 -database DEV -inputfile "D:\BuildDatabase.sql" -verbose | out-file -filepath "D:\SqlLog.txt"
The script generates an error (in red), as well as some print statements (in yellow), that are displayed on the powershell console when run. However, no output is written to the log file.
The SqlLog file is created successfully, but it is empty.
The messages I want to put into the file are displayed on the console screen. I just can't get them there.