Copy-SqlJob may be duplicating actions
During testing for PR #133 I noticed the -Whatif output seemed to be duplicating.
What if: Performing the operation "Creating Job Some Report Job" on target "somesqlserver". What if: Performing the operation "Creating Job Some Report Job" on target "somesqlserver". What if: Performing the operation "Showing finished message" on target "console".
Without the WhatIf (still including -Verbose, easier to see when you remove the Write-Verbose $sql line, otherwise verbose outputs all the SQL used):
VERBOSE: Performing the operation "Creating Job Some Report Job" on target "somesqlserver". Copying Job Some Report Job VERBOSE: Performing the operation "Creating Job Some Report Job" on target "somesqlserver". Disabling Some Report Job on somesqlserver VERBOSE: Performing the operation "Showing finished message" on target "console". Job migration finished
Something I observed when using Copy-SqlJob. I was using the -DisableOnDestination flag and when I used -WhatIf, I got two messages for each action. However, when I ran the actual migration, I only got one actual execution. So it might just be how the -WhatIf info is being displayed.
The issue was with the $Pscmdlet.ShouldProcess messaging for the Disable block. Fixed in #142.