Skip to content

Commit 23849ca

Browse files
authored
Remove-DbaCredential - Correct retrieval of server name (#9860)
1 parent b902741 commit 23849ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

public/Remove-DbaCredential.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function Remove-DbaCredential {
106106
end {
107107
# We have to delete in the end block to prevent "Collection was modified; enumeration operation may not execute." if directly piped from Get-DbaCredential.
108108
foreach ($dbCredential in $dbCredentials) {
109-
if ($PSCmdlet.ShouldProcess($dbCredential.Parent.Parent.Name, "Removing the SQL credential $($dbCredential.Name) on $($dbCredential.Parent.Parent.Name)")) {
109+
if ($PSCmdlet.ShouldProcess($dbCredential.Parent.Name, "Removing the SQL credential $($dbCredential.Name) on $($dbCredential.Parent.Name)")) {
110110
$output = [PSCustomObject]@{
111111
ComputerName = $dbCredential.ComputerName
112112
InstanceName = $dbCredential.InstanceName
@@ -120,7 +120,7 @@ function Remove-DbaCredential {
120120
$output.Status = "Dropped"
121121
$output.IsRemoved = $true
122122
} catch {
123-
Stop-Function -Message "Failed removing the SQL credential $($dbCredential.Name) on $($dbCredential.Parent.Parent.Name)" -ErrorRecord $_
123+
Stop-Function -Message "Failed removing the SQL credential $($dbCredential.Name) on $($dbCredential.Parent.Name)" -ErrorRecord $_
124124
$output.Status = (Get-ErrorMessage -Record $_)
125125
$output.IsRemoved = $false
126126
}

0 commit comments

Comments
 (0)