diff --git a/scripts/CleanupArchive.ps1 b/scripts/CleanupArchive.ps1 index a577fbe1..6a802057 100644 --- a/scripts/CleanupArchive.ps1 +++ b/scripts/CleanupArchive.ps1 @@ -34,6 +34,9 @@ param( [switch]$Commit ) +Import-Module (Join-Path $PSScriptRoot '..' 'src/Logging/Logging.psd1') -Force -ErrorAction SilentlyContinue +Show-STPrompt -Command $MyInvocation.Line + if ($Commit) { $response = Read-Host 'This will permanently delete items from the archive. Continue? (y/N)' if ($response -notmatch '^[Yy]$') { @@ -193,3 +196,4 @@ else { Write-STStatus "Deletion complete. Snapshot saved to $SnapshotPath" -Level FINAL } +Write-STClosing diff --git a/scripts/CleanupGroupMembership.ps1 b/scripts/CleanupGroupMembership.ps1 index 00c5b78a..91582082 100644 --- a/scripts/CleanupGroupMembership.ps1 +++ b/scripts/CleanupGroupMembership.ps1 @@ -10,6 +10,7 @@ . $PSScriptRoot/Common.ps1 Import-SupportToolsLogging +Show-STPrompt -Command $MyInvocation.Line param( [Parameter(Mandatory)][string]$CsvPath, @@ -56,3 +57,4 @@ if ($Cloud -eq 'Entra') { } Write-STStatus -Message 'Group membership cleanup finished.' -Level SUCCESS +Write-STClosing diff --git a/scripts/Install-SupportTools.ps1 b/scripts/Install-SupportTools.ps1 index e80d339c..8b6b34bd 100644 --- a/scripts/Install-SupportTools.ps1 +++ b/scripts/Install-SupportTools.ps1 @@ -13,14 +13,17 @@ .EXAMPLE ./Install-SupportTools.ps1 #> + param( [string]$SupportToolsVersion, [ValidateSet('CurrentUser','AllUsers')] [string]$Scope = 'CurrentUser' ) -# Load Logging first so status functions are available -# Import-Module (Join-Path $PSScriptRoot '..' 'src/Logging/Logging.psd1') -Force -ErrorAction SilentlyContinue -DisableNameChecking +# Import Logging so style helpers are available +Import-Module (Join-Path $PSScriptRoot '..' 'src/Logging/Logging.psd1') -Force -ErrorAction SilentlyContinue + +Show-STPrompt -Command $MyInvocation.Line $modules = @( 'Telemetry', @@ -30,17 +33,17 @@ $modules = @( 'IncidentResponseTools' ) -Write-Host '$ ./scripts/Install-SupportTools.ps1' +Write-STStatus -Message '$ ./scripts/Install-SupportTools.ps1' -Level INFO foreach ($module in $modules) { $localPath = Join-Path $PSScriptRoot '..' 'src' $module "$module.psd1" if (Test-Path $localPath) { - Write-Host "Importing $module..." + Write-STStatus -Message "Importing $module..." -Level INFO Import-Module $localPath -Force -DisableNameChecking - Write-Host "Imported $module from $localPath" + Write-STStatus -Message "Imported $module from $localPath" -Level SUCCESS } else { - Write-Host "Could not find $module in src" + Write-STStatus -Message "Could not find $module in src" -Level WARN } } -Write-Host 'Module import complete' +Write-STClosing 'Module import complete' diff --git a/scripts/Process-TerminationTickets.ps1 b/scripts/Process-TerminationTickets.ps1 index 39638e80..6209c14e 100644 --- a/scripts/Process-TerminationTickets.ps1 +++ b/scripts/Process-TerminationTickets.ps1 @@ -30,6 +30,7 @@ param( ) Import-Module (Join-Path $PSScriptRoot '..' 'src/Logging/Logging.psd1') -Force -ErrorAction SilentlyContinue +Show-STPrompt -Command $MyInvocation.Line Import-Module (Join-Path $PSScriptRoot '..' 'src/ServiceDeskTools/ServiceDeskTools.psd1') -Force -ErrorAction SilentlyContinue Import-Module (Join-Path $PSScriptRoot '..' 'src/EntraIDTools/EntraIDTools.psd1') -Force -ErrorAction SilentlyContinue @@ -61,3 +62,4 @@ while ($true) { $processed | ConvertTo-Json | Out-File -FilePath $StatePath -Encoding utf8 Start-Sleep -Seconds ($PollMinutes * 60) } +Write-STClosing diff --git a/scripts/Update-ModuleDependencies.ps1 b/scripts/Update-ModuleDependencies.ps1 index 01c12e4d..25053643 100644 --- a/scripts/Update-ModuleDependencies.ps1 +++ b/scripts/Update-ModuleDependencies.ps1 @@ -11,6 +11,7 @@ #> Import-Module (Join-Path $PSScriptRoot '..' 'src/Logging/Logging.psd1') -Force -ErrorAction SilentlyContinue +Show-STPrompt -Command $MyInvocation.Line $nuspecPath = Join-Path $PSScriptRoot '..' 'SupportTools.nuspec' [xml]$nuspec = Get-Content $nuspecPath @@ -41,3 +42,4 @@ foreach ($module in $modules) { Write-STLog -Message "Failed to validate $module: $($_.Exception.Message)" -Level ERROR } } +Write-STClosing diff --git a/src/SupportTools/Public/Invoke-JobBundle.ps1 b/src/SupportTools/Public/Invoke-JobBundle.ps1 index f5aeb994..b48b3af8 100644 --- a/src/SupportTools/Public/Invoke-JobBundle.ps1 +++ b/src/SupportTools/Public/Invoke-JobBundle.ps1 @@ -30,6 +30,8 @@ function Invoke-JobBundle { [string]$LogArchivePath ) + Show-STPrompt -Command $MyInvocation.Line + process { if (-not $LogArchivePath) { $LogArchivePath = $Path -replace '\\.zip$','-logs.zip' @@ -56,6 +58,7 @@ function Invoke-JobBundle { throw } Write-STStatus "Logs archived to $LogArchivePath" -Level SUCCESS + Write-STClosing return [pscustomobject]@{ LogArchivePath = $LogArchivePath }