mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2026-10-08 11:39:10 +11:00
* 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>
17 lines
596 B
PowerShell
17 lines
596 B
PowerShell
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")
|
|
}
|