I'm writing a script that will perform some git actions and I want to use Start-Transcript
to monitor it. The transcript is however missing most of the git
output.
I've tried to pipe the git
output to both Out-Host
and Out-Default
but neither work.
Here's my code...
$DateTime = Get-Date -Format "yyyyMMdd_HHmmss"
$TranscriptName = "PSTranscript_$DateTime"
Start-Transcript -Path ".\$TranscriptName.txt"
git --bare clone <GIT_REPO_URL> repo | Out-Default
Stop-Transcript
Here's my console output...
Transcript started, output file is .\PSTranscript_20191119_155424.txt
Cloning into 'repo'...
remote: Counting objects: 58975, done.
remote: Compressing objects: 100% (21457/21457), done.
remote: Total 58975 (delta 43348), reused 51727 (delta 37145)
Receiving objects: 100% (58975/58975), 70.46 MiB | 3.95 MiB/s, done.
Resolving deltas: 100% (43348/43348), done.
Checking out files: 100% (3878/3878), done.
Transcript stopped, output file is .\PSTranscript_20191119_155424.txt
And here's what is captured in the transcript, note that some of the git
output is missing
**********************
Windows PowerShell transcript start
Start time: 20191119155424
Username:
RunAs User:
Configuration Name:
Machine:
Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Process ID: 20644
PSVersion: 5.1.17134.858
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.17134.858
BuildVersion: 10.0.17134.858
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
**********************
Transcript started, output file is .\PSTranscript_20191119_155424.txt
**********************
Windows PowerShell transcript end
End time: 20191119155457
**********************