File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,11 +71,11 @@ function Remove-PDCClone {
7171 Removes all clones from Host1
7272
7373#>
74- [CmdLetBinding (, DefaultParameterSetName = " HostName" )]
74+ [CmdLetBinding (DefaultParameterSetName = " HostName" , SupportsShouldProcess = $true ,
75+ ConfirmImpact = ' High' )]
7576
7677 param (
77- [parameter (Mandatory = $true , ParameterSetName = " HostName" )]
78- [ValidateNotNullOrEmpty ()]
78+ [parameter (ParameterSetName = " HostName" )]
7979 [string []]$HostName ,
8080 [System.Management.Automation.PSCredential ]
8181 $SqlCredential ,
@@ -102,6 +102,14 @@ function Remove-PDCClone {
102102 $pdcSqlInstance = Get-PSFConfigValue - FullName psdatabaseclone.database.server
103103 $pdcDatabase = Get-PSFConfigValue - FullName psdatabaseclone.database.name
104104
105+ if (-not $HostName -and -not $InputObject ) {
106+
107+ if (-not $PSCmdlet.ShouldProcess (" All hosts" , " Delete all clones on all hosts?`n If not please say no and use -HostName and/or -Database" )){
108+ return
109+ }
110+
111+ }
112+
105113 Write-PSFMessage - Message " Started removing database clones" - Level Verbose
106114
107115 # Get all the items
You can’t perform that action at this time.
0 commit comments