Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions public/Disable-DbaDbEncryption.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ function Disable-DbaDbEncryption {
Write-Message -Level Verbose -Message "Database state for $($db.Name) on $($server.Name): $($db.DatabaseEncryptionKey.EncryptionState)"
}
while ($db.DatabaseEncryptionKey.EncryptionState -notin "Unencrypted", "None")
Write-ProgressHelper -Completed

if (-not $NoEncryptionKeyDrop) {
# https://www.sqlservercentral.com/steps/stairway-to-tde-removing-tde-from-a-database
Expand Down
1 change: 1 addition & 0 deletions public/Export-DbaUser.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ function Export-DbaUser {
$sql
}
}
Write-ProgressHelper -Completed
}
# Just a single file, output path once here
if (-Not $GenerateFilePerUser -and $FilePath) {
Expand Down
1 change: 1 addition & 0 deletions public/Find-DbaInstance.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ function Find-DbaInstance {
}
}

Write-ProgressHelper -Activity "Processing: $($computer)" -Completed
$masterList | Where-Object { $_.Confidence -ge $MinimumConfidence }
}
}
Expand Down
1 change: 1 addition & 0 deletions public/Import-DbaCsv.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,7 @@ WHERE c.object_id = OBJECT_ID(@tableName)
} else {
Write-Progress -Id 1 -Activity "Inserting $($script:totalRowsCopied) rows" -Status "Failed" -Completed
}
Write-Progress -Activity "Importing from $file" -Completed
}
}
if ($PSCmdlet.ShouldProcess($instance, "Finalizing import")) {
Expand Down
1 change: 1 addition & 0 deletions public/Import-DbaParquet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,7 @@ WHERE c.object_id = OBJECT_ID(@tableName)
} else {
Write-Progress -Id 1 -Activity "Inserting $($script:totalRowsCopied) rows" -Status "Failed" -Completed
}
Write-Progress -Activity "Importing from $file" -Completed
}
}
# Clean up Parquet reader if ShouldProcess was skipped (WhatIf mode)
Expand Down
1 change: 1 addition & 0 deletions public/Install-DbaSqlWatch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,6 @@ function Install-DbaSqlWatch {
Write-Message -Level Verbose -Message "Finished installing/updating SqlWatch in $database on $instance."
}
}
Write-ProgressHelper -Completed
}
}
1 change: 1 addition & 0 deletions public/Invoke-DbaDbDataGenerator.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ function Invoke-DbaDbDataGenerator {
}
}
}
Write-ProgressHelper -Completed

try {
$sqlconn.Close()
Expand Down
1 change: 1 addition & 0 deletions public/Invoke-DbaDbDataMasking.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,7 @@ function Invoke-DbaDbDataMasking {
}
}
} # End foreach database
Write-ProgressHelper -Completed

# Do some cleanup
$null = $server.Databases['tempdb'].Tables.Refresh()
Expand Down
1 change: 1 addition & 0 deletions public/Invoke-DbaDbMirroring.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -426,5 +426,6 @@ function Invoke-DbaDbMirroring {
}
}
}
Write-ProgressHelper -Completed
}
}
1 change: 1 addition & 0 deletions public/New-DbaComputerCertificate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ function New-DbaComputerCertificate {
Stop-Function "Isue removing files from $certDir" -Target $certDir -ErrorRecord $_
}
}
Write-ProgressHelper -Completed
}
}
}
1 change: 1 addition & 0 deletions public/New-DbaComputerCertificateSigningRequest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ function New-DbaComputerCertificateSigningRequest {
}
Get-ChildItem $certCfg, $certCsr
}
Write-ProgressHelper -Completed
}
}
}
2 changes: 2 additions & 0 deletions public/New-DbatoolsSupportPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ Ideally start a new console, perform the minimal steps required to reproduce the
$hash["Variables"] = $Variables | Get-Variable -ErrorAction Ignore
}

Write-ProgressHelper -Completed

$data = [PSCustomObject]$hash

try {
Expand Down
1 change: 1 addition & 0 deletions public/Read-DbaBackupHeader.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ function Read-DbaBackupHeader {
}
Start-Sleep -Milliseconds 500
}
Write-Progress -Id 1 -Activity Updating -Completed
#Close the runspace pool
$runspacePool.Close()
[System.Management.Automation.Runspaces.Runspace]::DefaultRunspace = $defaultrunspace
Expand Down
9 changes: 5 additions & 4 deletions public/Remove-DbaNetworkCertificate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ function Remove-DbaNetworkCertificate {

if ([System.String]::IsNullOrEmpty($vsname)) { $vsname = $instance }

Write-ProgressHelper -StepNumber ($stepCounter++) -Message "Regroot: $regRoot" -Target $instance
Write-ProgressHelper -StepNumber ($stepCounter++) -Message "ServiceAcct: $serviceAccount" -Target $instance
Write-ProgressHelper -StepNumber ($stepCounter++) -Message "InstanceName: $instanceName" -Target $instance
Write-ProgressHelper -StepNumber ($stepCounter++) -Message "VSNAME: $vsname" -Target $instance
Write-ProgressHelper -StepNumber ($stepCounter++) -Message "Regroot: $regRoot"
Write-ProgressHelper -StepNumber ($stepCounter++) -Message "ServiceAcct: $serviceAccount"
Write-ProgressHelper -StepNumber ($stepCounter++) -Message "InstanceName: $instanceName"
Write-ProgressHelper -StepNumber ($stepCounter++) -Message "VSNAME: $vsname"

$scriptblock = {
$regRoot = $args[0]
Expand Down Expand Up @@ -147,6 +147,7 @@ function Remove-DbaNetworkCertificate {
Stop-Function -Message "Failed to connect to $($resolved.fqdn) using PowerShell remoting." -ErrorRecord $_ -Target $instance -Continue
}
}
Write-ProgressHelper -Completed
}
}
}
1 change: 1 addition & 0 deletions public/Reset-DbaAdmin.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ function Reset-DbaAdmin {
}
}
}
Write-ProgressHelper -Completed

}
}
Expand Down
2 changes: 2 additions & 0 deletions public/Save-DbaDiagnosticQueryScript.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,10 @@ function Save-DbaDiagnosticQueryScript {
Invoke-TlsWebRequest -Uri $link -OutFile $filename -ErrorAction Stop
Get-ChildItem -Path $filename
} catch {
Write-ProgressHelper -Completed
Stop-Function -Message "Requesting and writing file failed: $_" -Target $filename -ErrorRecord $_
return
}
}
Write-ProgressHelper -Completed
}
1 change: 1 addition & 0 deletions public/Set-DbaNetworkCertificate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ function Set-DbaNetworkCertificate {
Notes = $notes
}
}
Write-ProgressHelper -Completed
}
}
}
2 changes: 2 additions & 0 deletions public/Start-DbaDbEncryption.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ function Start-DbaDbEncryption {
Stop-Function -Message "Failure" -ErrorRecord $_ -Continue
}
}
Write-ProgressHelper -Completed
} else {
# Parallel processing - group databases by instance and pre-create shared resources
$instanceGroups = $InputObject | Group-Object -Property { $_.Parent.Name }
Expand Down Expand Up @@ -615,6 +616,7 @@ function Start-DbaDbEncryption {
}
Start-Sleep -Milliseconds 500
}
Write-Progress -Id 1 -Activity "Enabling encryption on $servername" -Completed

$runspacePool.Close()
$runspacePool.Dispose()
Expand Down
1 change: 1 addition & 0 deletions public/Start-DbaMigration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ function Start-DbaMigration {
Write-Message -Level Verbose -Message "Skipping SSIS catalog migration because the source instance does not have an SSISDB catalog."
}
}
Write-ProgressHelper -Completed
}
end {
if ($dacOpened) {
Expand Down
2 changes: 2 additions & 0 deletions public/Stop-DbaDbEncryption.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ function Stop-DbaDbEncryption {
Stop-Function -Message "Failure" -ErrorRecord $_ -Continue
}
}
Write-ProgressHelper -Completed
} else {
# Parallel processing using runspaces
$disableScript = {
Expand Down Expand Up @@ -249,6 +250,7 @@ function Stop-DbaDbEncryption {
}
Start-Sleep -Milliseconds 500
}
Write-Progress -Id 1 -Activity "Disabling encryption" -Completed

$runspacePool.Close()
$runspacePool.Dispose()
Expand Down
1 change: 1 addition & 0 deletions public/Sync-DbaAvailabilityGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ function Sync-DbaAvailabilityGroup {
Write-ProgressHelper -Activity $activity -StepNumber ($stepCounter++) -Message "Syncing login permissions"
Sync-DbaLoginPermission -Source $server -Destination $secondaries -Login $Login -ExcludeLogin $ExcludeLogin
}
Write-ProgressHelper -Activity $activity -Completed
}
}
}
1 change: 1 addition & 0 deletions public/Sync-DbaLoginPermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ function Sync-DbaLoginPermission {
Stop-Function -Message "Issue syncing permissions for login" -Target $loginName -ErrorRecord $_ -Continue
}
}
Write-ProgressHelper -Completed
} finally {
Restore-DatabaseContext -Server $destServer -Database $destCallerDatabase
}
Expand Down