mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2026-10-09 21:21:18 +11:00
feat: add automated environment report export (#5025)
* feat: add automated environment report export * refactor: address code review comments * fix: refresh toggle state in environment report * fix: surface environment report read failures * test: make registry failure explicit --------- Co-authored-by: Chris Titus <contact@christitus.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
function Get-WinUtilEnvironmentReportLogsPath {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Derives the companion logs .txt path from the environment report's JSON save path.
|
||||
#>
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$JsonPath
|
||||
)
|
||||
|
||||
# ChangeExtension($JsonPath, $null) leaves a trailing dot instead of stripping it, so build the
|
||||
# name from its parts instead.
|
||||
$directory = [System.IO.Path]::GetDirectoryName($JsonPath)
|
||||
$baseName = [System.IO.Path]::GetFileNameWithoutExtension($JsonPath)
|
||||
return [System.IO.Path]::Combine($directory, "${baseName}_logs.txt")
|
||||
}
|
||||
Reference in New Issue
Block a user