Skip to content

Commit 8a7e4e0

Browse files
committed
Add OpenVPN logs to the reporting script
1 parent 52a6892 commit 8a7e4e0

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Report.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Elevate($myinvocation.MyCommand.Definition)
1919

2020
$host.ui.RawUI.WindowTitle = "Mika's reporting script"
2121

22+
# These variables are defined already here so that they are available also
23+
# when only running the Compress-ReportArchive below.
2224
# $Downloads = ".\Downloads"
2325
$Reports = "${PSScriptRoot}\Reports"
2426
$Timestamp = Get-Date -Format "yyyy-MM-dd_HH-mm"
@@ -112,6 +114,15 @@ if (Test-CommandExists "netsh") {
112114
Show-Output "The command `"netsh`" was not found."
113115
}
114116

117+
$OpenVPNLogs = "${UserDir}\OpenVPN\log"
118+
if (Test-Path "${OpenVPNLogs}") {
119+
Show-Output "OpenVPN log folder found. Copying logs."
120+
New-Item -Path "${Reports}" -Name "OpenVPN" -ItemType "directory" -Force | Out-Null
121+
Copy-Item -Path "${OpenVPNLogs}\*" -Destination "${Reports}\OpenVPN"
122+
} else {
123+
Show-Output "OpenVPN log folder was not found."
124+
}
125+
115126
if (Test-CommandExists "powercfg") {
116127
Show-Output "Creating battery report."
117128
powercfg /availablesleepstates > "${Reports}\powercfg_sleepstates.html"

Utils.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ $DesktopPath = [Environment]::GetFolderPath([Environment+SpecialFolder]::Desktop
7171
$StartPath = Get-Location
7272

7373
# Define some useful variables
74-
$RepoInUserDir = ([System.IO.DirectoryInfo]"${RepoPath}").FullName.StartsWith(([System.IO.DirectoryInfo]"${env:UserProfile}").FullName)
74+
$UserDir = ([System.IO.DirectoryInfo]"${env:UserProfile}").FullName
75+
$RepoInUserDir = ([System.IO.DirectoryInfo]"${RepoPath}").FullName.StartsWith($UserDir)
7576

7677
# This will be filled by Get-InstalledSoftware
7778
$InstalledSoftware = $null

0 commit comments

Comments
 (0)