Skip to content

Commit d655259

Browse files
Update-DbaInstance - Add early validation for empty -Path parameter (#10283)
1 parent 3bda327 commit d655259

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

public/Update-DbaInstance.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ function Update-DbaInstance {
274274
}
275275
}
276276
}
277+
if (-not $Path) {
278+
Stop-Function -Category InvalidArgument -Message "Path is required. Please provide a -Path to a folder containing (or to store) SQL Server updates, or configure a default with Set-DbatoolsConfig -Name Path.SQLServerUpdates -Value 'C:\patches'."
279+
return
280+
}
277281
$actions = @()
278282
$actionTemplate = @{ }
279283
if ($InstanceName) { $actionTemplate.InstanceName = $InstanceName }

0 commit comments

Comments
 (0)