diff --git a/public/Disable-DbaDbEncryption.ps1 b/public/Disable-DbaDbEncryption.ps1 index 6be76710873..81ea15a2325 100644 --- a/public/Disable-DbaDbEncryption.ps1 +++ b/public/Disable-DbaDbEncryption.ps1 @@ -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 diff --git a/public/Export-DbaUser.ps1 b/public/Export-DbaUser.ps1 index 9ae28df9797..de500bac734 100644 --- a/public/Export-DbaUser.ps1 +++ b/public/Export-DbaUser.ps1 @@ -645,6 +645,7 @@ function Export-DbaUser { $sql } } + Write-ProgressHelper -Completed } # Just a single file, output path once here if (-Not $GenerateFilePerUser -and $FilePath) { diff --git a/public/Find-DbaInstance.ps1 b/public/Find-DbaInstance.ps1 index 13479860a1e..c81648f929a 100644 --- a/public/Find-DbaInstance.ps1 +++ b/public/Find-DbaInstance.ps1 @@ -597,6 +597,7 @@ function Find-DbaInstance { } } + Write-ProgressHelper -Activity "Processing: $($computer)" -Completed $masterList | Where-Object { $_.Confidence -ge $MinimumConfidence } } } diff --git a/public/Import-DbaCsv.ps1 b/public/Import-DbaCsv.ps1 index d1f9ca2b211..02b89059fd9 100644 --- a/public/Import-DbaCsv.ps1 +++ b/public/Import-DbaCsv.ps1 @@ -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")) { diff --git a/public/Import-DbaParquet.ps1 b/public/Import-DbaParquet.ps1 index a2086ed7f20..1ae62720024 100644 --- a/public/Import-DbaParquet.ps1 +++ b/public/Import-DbaParquet.ps1 @@ -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) diff --git a/public/Install-DbaSqlWatch.ps1 b/public/Install-DbaSqlWatch.ps1 index b0c2d7ab822..51cc1b039cd 100644 --- a/public/Install-DbaSqlWatch.ps1 +++ b/public/Install-DbaSqlWatch.ps1 @@ -196,5 +196,6 @@ function Install-DbaSqlWatch { Write-Message -Level Verbose -Message "Finished installing/updating SqlWatch in $database on $instance." } } + Write-ProgressHelper -Completed } } \ No newline at end of file diff --git a/public/Invoke-DbaDbDataGenerator.ps1 b/public/Invoke-DbaDbDataGenerator.ps1 index d66e83de01f..0e3345151e1 100644 --- a/public/Invoke-DbaDbDataGenerator.ps1 +++ b/public/Invoke-DbaDbDataGenerator.ps1 @@ -592,6 +592,7 @@ function Invoke-DbaDbDataGenerator { } } } + Write-ProgressHelper -Completed try { $sqlconn.Close() diff --git a/public/Invoke-DbaDbDataMasking.ps1 b/public/Invoke-DbaDbDataMasking.ps1 index 90685c9d09e..4b36c82ec6a 100644 --- a/public/Invoke-DbaDbDataMasking.ps1 +++ b/public/Invoke-DbaDbDataMasking.ps1 @@ -1374,6 +1374,7 @@ function Invoke-DbaDbDataMasking { } } } # End foreach database + Write-ProgressHelper -Completed # Do some cleanup $null = $server.Databases['tempdb'].Tables.Refresh() diff --git a/public/Invoke-DbaDbMirroring.ps1 b/public/Invoke-DbaDbMirroring.ps1 index 7863eb17014..7da7af98c18 100644 --- a/public/Invoke-DbaDbMirroring.ps1 +++ b/public/Invoke-DbaDbMirroring.ps1 @@ -426,5 +426,6 @@ function Invoke-DbaDbMirroring { } } } + Write-ProgressHelper -Completed } } \ No newline at end of file diff --git a/public/New-DbaComputerCertificate.ps1 b/public/New-DbaComputerCertificate.ps1 index 3d6d4ee7906..c2dce0af354 100644 --- a/public/New-DbaComputerCertificate.ps1 +++ b/public/New-DbaComputerCertificate.ps1 @@ -526,6 +526,7 @@ function New-DbaComputerCertificate { Stop-Function "Isue removing files from $certDir" -Target $certDir -ErrorRecord $_ } } + Write-ProgressHelper -Completed } } } \ No newline at end of file diff --git a/public/New-DbaComputerCertificateSigningRequest.ps1 b/public/New-DbaComputerCertificateSigningRequest.ps1 index c9bc97a566b..dba75966554 100644 --- a/public/New-DbaComputerCertificateSigningRequest.ps1 +++ b/public/New-DbaComputerCertificateSigningRequest.ps1 @@ -258,6 +258,7 @@ function New-DbaComputerCertificateSigningRequest { } Get-ChildItem $certCfg, $certCsr } + Write-ProgressHelper -Completed } } } \ No newline at end of file diff --git a/public/New-DbatoolsSupportPackage.ps1 b/public/New-DbatoolsSupportPackage.ps1 index 26f8e207b6a..7ea4d5cbc40 100644 --- a/public/New-DbatoolsSupportPackage.ps1 +++ b/public/New-DbatoolsSupportPackage.ps1 @@ -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 { diff --git a/public/Read-DbaBackupHeader.ps1 b/public/Read-DbaBackupHeader.ps1 index 9091caa67af..237e9225021 100644 --- a/public/Read-DbaBackupHeader.ps1 +++ b/public/Read-DbaBackupHeader.ps1 @@ -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 diff --git a/public/Remove-DbaNetworkCertificate.ps1 b/public/Remove-DbaNetworkCertificate.ps1 index 54167d00bb5..616662fdfb8 100644 --- a/public/Remove-DbaNetworkCertificate.ps1 +++ b/public/Remove-DbaNetworkCertificate.ps1 @@ -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] @@ -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 } } } \ No newline at end of file diff --git a/public/Reset-DbaAdmin.ps1 b/public/Reset-DbaAdmin.ps1 index d2fffc72e8e..9a57c8c9092 100644 --- a/public/Reset-DbaAdmin.ps1 +++ b/public/Reset-DbaAdmin.ps1 @@ -448,6 +448,7 @@ function Reset-DbaAdmin { } } } + Write-ProgressHelper -Completed } } diff --git a/public/Save-DbaDiagnosticQueryScript.ps1 b/public/Save-DbaDiagnosticQueryScript.ps1 index bb0d53a5628..368b6f68678 100644 --- a/public/Save-DbaDiagnosticQueryScript.ps1 +++ b/public/Save-DbaDiagnosticQueryScript.ps1 @@ -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 } \ No newline at end of file diff --git a/public/Set-DbaNetworkCertificate.ps1 b/public/Set-DbaNetworkCertificate.ps1 index 8a37c4764e0..c9154a7ada2 100644 --- a/public/Set-DbaNetworkCertificate.ps1 +++ b/public/Set-DbaNetworkCertificate.ps1 @@ -423,6 +423,7 @@ function Set-DbaNetworkCertificate { Notes = $notes } } + Write-ProgressHelper -Completed } } } diff --git a/public/Start-DbaDbEncryption.ps1 b/public/Start-DbaDbEncryption.ps1 index 689ab20866e..a974af83c69 100644 --- a/public/Start-DbaDbEncryption.ps1 +++ b/public/Start-DbaDbEncryption.ps1 @@ -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 } @@ -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() diff --git a/public/Start-DbaMigration.ps1 b/public/Start-DbaMigration.ps1 index 8eedb493bbf..e3a4dc56763 100644 --- a/public/Start-DbaMigration.ps1 +++ b/public/Start-DbaMigration.ps1 @@ -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) { diff --git a/public/Stop-DbaDbEncryption.ps1 b/public/Stop-DbaDbEncryption.ps1 index 70d80c4c32b..e852fa9357a 100644 --- a/public/Stop-DbaDbEncryption.ps1 +++ b/public/Stop-DbaDbEncryption.ps1 @@ -110,6 +110,7 @@ function Stop-DbaDbEncryption { Stop-Function -Message "Failure" -ErrorRecord $_ -Continue } } + Write-ProgressHelper -Completed } else { # Parallel processing using runspaces $disableScript = { @@ -249,6 +250,7 @@ function Stop-DbaDbEncryption { } Start-Sleep -Milliseconds 500 } + Write-Progress -Id 1 -Activity "Disabling encryption" -Completed $runspacePool.Close() $runspacePool.Dispose() diff --git a/public/Sync-DbaAvailabilityGroup.ps1 b/public/Sync-DbaAvailabilityGroup.ps1 index 6c7508229b1..aba3cdd2960 100644 --- a/public/Sync-DbaAvailabilityGroup.ps1 +++ b/public/Sync-DbaAvailabilityGroup.ps1 @@ -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 } } } \ No newline at end of file diff --git a/public/Sync-DbaLoginPermission.ps1 b/public/Sync-DbaLoginPermission.ps1 index 638f9cc42fd..faa0202dee0 100644 --- a/public/Sync-DbaLoginPermission.ps1 +++ b/public/Sync-DbaLoginPermission.ps1 @@ -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 }