Skip to content
Open
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
4 changes: 4 additions & 0 deletions scripts/CleanupArchive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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]$') {
Expand Down Expand Up @@ -193,3 +196,4 @@ else
{
Write-STStatus "Deletion complete. Snapshot saved to $SnapshotPath" -Level FINAL
}
Write-STClosing
2 changes: 2 additions & 0 deletions scripts/CleanupGroupMembership.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

. $PSScriptRoot/Common.ps1
Import-SupportToolsLogging
Show-STPrompt -Command $MyInvocation.Line

param(
[Parameter(Mandatory)][string]$CsvPath,
Expand Down Expand Up @@ -56,3 +57,4 @@ if ($Cloud -eq 'Entra') {
}

Write-STStatus -Message 'Group membership cleanup finished.' -Level SUCCESS
Write-STClosing
17 changes: 10 additions & 7 deletions scripts/Install-SupportTools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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'
2 changes: 2 additions & 0 deletions scripts/Process-TerminationTickets.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -61,3 +62,4 @@ while ($true) {
$processed | ConvertTo-Json | Out-File -FilePath $StatePath -Encoding utf8
Start-Sleep -Seconds ($PollMinutes * 60)
}
Write-STClosing
2 changes: 2 additions & 0 deletions scripts/Update-ModuleDependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -41,3 +42,4 @@ foreach ($module in $modules) {
Write-STLog -Message "Failed to validate $module: $($_.Exception.Message)" -Level ERROR
}
}
Write-STClosing
3 changes: 3 additions & 0 deletions src/SupportTools/Public/Invoke-JobBundle.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ function Invoke-JobBundle {
[string]$LogArchivePath
)

Show-STPrompt -Command $MyInvocation.Line

process {
if (-not $LogArchivePath) {
$LogArchivePath = $Path -replace '\\.zip$','-logs.zip'
Expand All @@ -56,6 +58,7 @@ function Invoke-JobBundle {
throw
}
Write-STStatus "Logs archived to $LogArchivePath" -Level SUCCESS
Write-STClosing
return [pscustomobject]@{
LogArchivePath = $LogArchivePath
}
Expand Down
Loading