Skip to content

Commit

Permalink
New-DbaAgentJob: Fix wrong output when using -Force to remove existin…
Browse files Browse the repository at this point in the history
…g job (#9512)
  • Loading branch information
andreasjordan authored Oct 14, 2024
1 parent f0423f5 commit e674fc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion public/New-DbaAgentJob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function New-DbaAgentJob {

if ($PSCmdlet.ShouldProcess($instance, "Removing the job $Job on $instance")) {
try {
Remove-DbaAgentJob -SqlInstance $server -Job $Job -EnableException -Confirm:$false
$null = Remove-DbaAgentJob -SqlInstance $server -Job $Job -EnableException -Confirm:$false
$server.JobServer.Refresh()
} catch {
Stop-Function -Message "Couldn't remove job $Job from $instance" -Target $instance -Continue -ErrorRecord $_
Expand Down

0 comments on commit e674fc7

Please sign in to comment.