Skip to content

Conversation

@rulasg
Copy link
Owner

@rulasg rulasg commented Oct 10, 2025

Introduce helper functions for managing transcript files during tests, along with corresponding tests to validate their functionality.


$TEST_TRANSCRIPT_FILE = "test_transcript.log"

function Start-MyTranscript {

Check warning

Code scanning / PSScriptAnalyzer

Function 'Start-MyTranscript' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. Warning

Function 'Start-MyTranscript' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'.
Start-Transcript -Path $TEST_TRANSCRIPT_FILE
}

function Stop-MyTranscript {

Check warning

Code scanning / PSScriptAnalyzer

Function 'Stop-MyTranscript' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. Warning

Function 'Stop-MyTranscript' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'.

Start-MyTranscript

Write-Host "This is a test transcript."

Check warning

Code scanning / PSScriptAnalyzer

File 'transcriptHelp.test.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning

File 'transcriptHelp.test.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information.
@rulasg rulasg merged commit 9769743 into main Oct 10, 2025
3 checks passed
@rulasg rulasg deleted the transcriptHelp branch October 10, 2025 17:54
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

Successfully merging this pull request may close these issues.

2 participants