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
31 changes: 1 addition & 30 deletions Docs/Icon/offboarding-icon-color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 1 addition & 30 deletions Docs/Icon/offboarding-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Docs/Images/MainWindow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Docs/Images/Settings-Workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Docs/Images/Settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions Functions/Core/Logging/Write-ErrorLog.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function Write-ErrorLog {
param(
[string]$ErrorMessage,
[string]$Location
)

$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$logMessage = "[$timestamp] ERROR in $Location`: $ErrorMessage"

# Ensure log directory exists
$logDir = Join-Path $script:BasePath "Logs"
if (-not (Test-Path $logDir)) {
New-Item -ItemType Directory -Path $logDir | Out-Null
}

# Write to log file
$logFile = Join-Path $logDir "error_log.txt"
$logMessage | Out-File -FilePath $logFile -Append

# Also write to console
Write-Host $logMessage -ForegroundColor Red
}
35 changes: 6 additions & 29 deletions Start-Offboarding.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ try {
. "$PSScriptRoot\Functions\Utilities\PathUtils.ps1"
$currentPath = Get-BasePath
$script:BasePath = Split-Path -Parent (Split-Path -Parent $currentPath) # Move two folders higher

# Import Core functions
. "$script:BasePath\Functions\Core\Environment.ps1"
. "$script:BasePath\Functions\Core\Logging\Write-ActivityLog.ps1"
. "$script:BasePath\Functions\Core\Logging\Write-ErrorLog.ps1"
. "$script:BasePath\Functions\Core\Dependencies\DotNetVersionCheck.ps1"

# Import Data functions
. "$script:BasePath\Functions\Data\Mock\MockData.ps1"
Expand Down Expand Up @@ -59,11 +65,6 @@ Initialize-AppSettings
# Import workflow UI
. "$script:BasePath\Functions\UI\Workflow\Initialize-WorkflowTab.ps1"

# Import Core functions
. "$script:BasePath\Functions\Core\Environment.ps1"
. "$script:BasePath\Functions\Core\Logging\Write-ActivityLog.ps1"
. "$script:BasePath\Functions\Core\Dependencies\DotNetVersionCheck.ps1"

# Import Shared functions
. "$script:BasePath\Functions\UI\Shared\XamlHelper.ps1"
. "$script:BasePath\Functions\UI\Shared\LoadingScreen.ps1"
Expand All @@ -88,30 +89,6 @@ Initialize-AppSettings

#. "$script:BasePath\Functions\UI\EasterEgg.ps1"

# Error handling function
function Write-ErrorLog {
param(
[string]$ErrorMessage,
[string]$Location
)

$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$logMessage = "[$timestamp] ERROR in $Location`: $ErrorMessage"

# Ensure log directory exists
$logDir = Join-Path $script:BasePath "Logs"
if (-not (Test-Path $logDir)) {
New-Item -ItemType Directory -Path $logDir | Out-Null
}

# Write to log file
$logFile = Join-Path $logDir "error_log.txt"
$logMessage | Out-File -FilePath $logFile -Append

# Also write to console
Write-Host $logMessage -ForegroundColor Red
}

# Version check
$minVersion = [Version]"5.1"
$currentVersion = $PSVersionTable.PSVersion
Expand Down