I currently have:
(invoke-sqlcmd -inputfile (Join-Path $FileDirectory $FileName) -ServerInstance $ServerName -verbose) > $OutFileName
To which I'm getting the output:
VERBOSE: Changed database context to 'BLUELABEL'
I'm trying to use the verbose output to write to the file designated by the Join-Path function.
What am I doing wrong?
(Using PowerShell V3)
I did find this question with answers, but it seems different and I can't seem to apply the same ideas: Powershell Invoke-Sqlcmd capture verbose output