I can't figure out why, when running the following script, the second "write-output" does not appear in the transcript file ???
start-transcript -Path "c:\temp\test_transcript.txt" -Append;
$acl = Get-Acl "c:\temp";
$acl | Format-Table -Wrap;
Write-Output "1) A very simple message BEFORE new-item.";
New-Item -Path "C:\temp" -Name "test_file_$(get-date -f "yyyyMMdd_HHmmss").txt" -ItemType File -Verbose -ErrorAction Stop;
#Why is th second message not included int the transcript log file ???
Write-Output "2) A very simple message AFTER new-item.";
Stop-Transcript;
Here is what I get in the transcript file :
Does someone have an explanation for this ?
TRANSCRIPT FILE :
Transcription démarrée, le fichier de sortie est c:\temp\test_transcript.txt
Répertoire : C:\
Path Owner Access
---- ----- ------ temp MyDomain\MyUser BUILTIN\XXX Allow FullControl
AUTORITE NT\XXX Allow FullControl
BUILTIN\XXX Allow ReadAndExecute, Synchronize
AUTORITE NT\XXX authentifiés Allow Modify, Synchronize
1) A very simple message BEFORE new-item.
EN CLAIR : Opération « Créer un fichier » en cours sur la cible « Destination : C:\temp\test_file_20230109_124005.txt ».
**********************
Fin de la transcription Windows PowerShell
Heure de fin : 20230109124005
**********************
CONSOLE :
Transcription démarrée, le fichier de sortie est c:\temp\test_transcript.txt
Répertoire : C:\
Path Owner Access
---- ----- ------
temp MyDomain\MyUser BUILTIN\XXX Allow FullControl
AUTORITE NT\XXX Allow FullControl
BUILTIN\XXX Allow ReadAndExecute, Synchronize
AUTORITE NT\XXX authentifiés Allow Modify, Synchronize
1) A very simple message BEFORE new-item.
EN CLAIR : Opération « Créer un fichier » en cours sur la cible « Destination : C:\temp\test_file_20230109_124005.txt ».
Répertoire : C:\temp
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 09/01/2023 12:40 0 test_file_20230109_124005.txt
2) A very simple message AFTER new-item.
Transcription arrêtée, le fichier de sortie est C:\temp\test_transcript.txt