Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transcript output points user to incorrect log location #45

Closed
Nevember opened this issue May 16, 2021 · 0 comments
Closed

Transcript output points user to incorrect log location #45

Nevember opened this issue May 16, 2021 · 0 comments

Comments

@Nevember
Copy link
Contributor

Hi!

Since Start-Transcript outputs to "$OutDir\Get-NetView.log", when stopped, host output points to $OutDir. Since the log actually gets moved to "$OutDir_Logs", users aren't aware of where to go for the actual Get-NetView.log.

For potential mitigation, can think of two options:
1)
Pipe Stop-Transcript to Out-Null;
After moving the file, Write-Output your own message pointing to "$logDir\Get-NetView.log" in the try/catch blocks for Stop-Transcript.
2)
Define $logDir in the "Initialize" function instead of "Completion";
Change the Path for Start-Transcript to "$logDir\Get-NetView.log";
Remove Move-Item from the Stop-Transcript try block.

Without knowing what else could break by moving things in option #2, I'd suggestion option #1.

Line  | Code
----- | ------------------
2648  | Stop-Transcript | Out-Null
2649  | <...>
2650  | Write-Output "Transcript stopped, output file is $logDir\Get-NetView.log"
Nevember added a commit to Nevember/Get-NetView that referenced this issue May 16, 2021
microsoft#45
Simple change so that the last output an end user sees points to the correct log location.
tmolenh pushed a commit that referenced this issue May 17, 2021
#45
Simple change so that the last output an end user sees points to the correct log location.
@tmolenh tmolenh closed this as completed May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants