Skip to content

Commit e674fc7

Browse files
New-DbaAgentJob: Fix wrong output when using -Force to remove existing job (#9512)
1 parent f0423f5 commit e674fc7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

public/New-DbaAgentJob.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ function New-DbaAgentJob {
250250

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

0 commit comments

Comments
 (0)