Skip to content

Commit c645a2a

Browse files
committed
Improved ShouldSupport
1 parent eab3cd0 commit c645a2a

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

functions/Remove-PSDCClone.ps1

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,13 @@
114114
}
115115

116116
# Test the module database setup
117-
try {
118-
Test-PSDCConfiguration -SqlCredential $pdcCredential -EnableException
119-
}
120-
catch {
121-
Stop-PSFFunction -Message "Something is wrong in the module configuration" -ErrorRecord $_ -Continue
117+
if ($PSCmdlet.ShouldProcess("Test-PSDCConfiguration", "Testing module setup")) {
118+
try {
119+
Test-PSDCConfiguration -SqlCredential $pdcCredential -EnableException
120+
}
121+
catch {
122+
Stop-PSFFunction -Message "Something is wrong in the module configuration" -ErrorRecord $_ -Continue
123+
}
122124
}
123125

124126
Write-PSFMessage -Message "Started removing database clones" -Level Verbose
@@ -244,7 +246,7 @@
244246
}
245247
}
246248

247-
if ($PSCmdlet.ShouldProcess($item.CloneID, "Deleting clone rom database")) {
249+
if ($PSCmdlet.ShouldProcess("Clone ID: $($item.CloneID)", "Deleting clone from database")) {
248250
# Removing records from database
249251
try {
250252
$query = "DELETE FROM dbo.Clone WHERE CloneID = $($item.CloneID);"

0 commit comments

Comments
 (0)