We have hundreds of Channel Database on multiple SQL server, usually we are facing the space issue. Now decided to move tempdb location from C to E drive with CDB path name (E:\Program Files\MMSSQLServer\MSSQL12.\MSSQL\Data\Tempdb.mdf)
I am able to move the Tempdb with below script. BUT not able to set path passing variables in sqlquery:
$OutputFile = "C:\SQLCMD\QueryOutput.txt"
$ExecuteQuery= Get-Content -path $QueryPath | out-string