Working on doing some automated patching in our SQL server environments. I am first taking a DB backup and then applying patches and then sending output in an email
I need to figure out the below:
how do I get the results of second command in the email? when I run this script I only get the output of the first command in the email. Columns in both the scripts are different.
[quote quote=200504]$Results = backup-dbadatabase -sqlinstance abcsqlserver -database ‘abc’ -path \abcsqlserver\Backup -type full -copyonly -compressbackup -ignorefilecheck;update-dbainstance abcsqlserver -KB 4019094 -path \abcsqlserver\Patches -restart -confirm:$false[/quote]; is a command separator in PowerShell, so $Results will have only the first command output and if you want the second command output as well then need to append the output of the second command to $Results
When I run the append script, it only gives results from 1 st command and also the common fields from 1st and 2nd command, but not all the columns from 2nd command