Files
winutil/functions/private/Get-WinUtilEnvironmentReportLogsPath.ps1
OmarandChris Titus 7ee5be3d2f 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>
2026-09-02 17:03:22 -05:00

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")
}