I have a powershell command that I want to be run in batch script. It works well in powershell window but I cannot call it properly in batch script. the powershell command goes like this:
invoke-sqlcmd -inputfile "D:\Reports\sql.sql" -ServerInstance SERVER1 | export-csv "D:\Rpt\historical\sample1.csv" -Force -En UTF8
I hope somebody could help me out. Also, is it possible to include batch variable in replace of the file path for input and output file instead of putting the whole path in powershell command (stil run inside in batch script)?
Thanks.