diff --git a/src/assets/scripts/check_software.ps1 b/src/assets/scripts/check_software.ps1 index 832b1a1..e5c7a2e 100644 --- a/src/assets/scripts/check_software.ps1 +++ b/src/assets/scripts/check_software.ps1 @@ -43,7 +43,6 @@ Function Enable-RemoteRegistry { } } catch { - $ErrorMessage = $Comp + " Error: " + $_.Exception.Message Add-Content ".\assets\settings\log.txt" -Value "$_" } } diff --git a/src/assets/scripts/functions.ps1 b/src/assets/scripts/functions.ps1 index 512d4aa..8699831 100644 --- a/src/assets/scripts/functions.ps1 +++ b/src/assets/scripts/functions.ps1 @@ -3,7 +3,9 @@ Function Set-Error { param( [string]$Message ) - Add-Content ".\assets\settings\log.txt" -Value "[$(Get-Date)]`n$Message`n" + $path = Get-Location + $path = $path.Path + "\storage\data\log.txt" + Add-Content "$path" -Value "[$(Get-Date)]`n$Message`n" } Function Enable-WinRM { diff --git a/src/assets/scripts/get_uptime.ps1 b/src/assets/scripts/get_uptime.ps1 index 1ac9a95..91be880 100644 --- a/src/assets/scripts/get_uptime.ps1 +++ b/src/assets/scripts/get_uptime.ps1 @@ -5,7 +5,7 @@ param( . .\assets\scripts\functions.ps1 $dontInvoke = $false -if($Computer -eq $env:COMPUTERNAME){ +if ($Computer -eq $env:COMPUTERNAME) { $dontInvoke = $true } diff --git a/src/assets/scripts/log_error.ps1 b/src/assets/scripts/log_error.ps1 deleted file mode 100644 index 7d93103..0000000 --- a/src/assets/scripts/log_error.ps1 +++ /dev/null @@ -1,8 +0,0 @@ -# Function used to consistently log powershell errors with a time stamp. - -Function Log-Error { - param( - [string]$Message - ) - Add-Content ".\assets\settings\log.txt" -Value "[$(Get-Date)]`n$Message`n" -} \ No newline at end of file diff --git a/src/main.py b/src/main.py index c2e0353..641677f 100644 --- a/src/main.py +++ b/src/main.py @@ -2875,7 +2875,7 @@ def open_errors(e): data = { "txt_document": True, - "txt_data": "assets/settings/log.txt" + "txt_data": f"{logging_path}" } content_container = ft.Column([