-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGourceCombine.ps1
More file actions
35 lines (27 loc) · 1 KB
/
GourceCombine.ps1
File metadata and controls
35 lines (27 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Define the base path
$basePath = "D:\Projects" # Replace with your actual path
# Get all directories in the base path
$directories = Get-ChildItem -Path $basePath -Directory
# Initialize a counter for naming log files
$logCounter = 1
# Iterate through each directory and run gource command
foreach ($dir in $directories) {
# Change to the directory
Set-Location $dir.FullName
# Run the gource command
$logFilePath = "$basePath\gource$logCounter.txt"
gource --output-custom-log $logFilePath $basePath\$dir
# Print log file creation
Write-Host "Gource output for $dir to: $basePath\$dir"
# Increase the counter for the next iteration
$logCounter++
}
# Change back to the base path
Set-Location $basePath
# Combine and sort all log files
Get-ChildItem -Filter "gource*.txt" |
Foreach-Object { Get-Content $_.FullName } |
Sort-Object { $_.Split("|")[0] -as [int] } |
Set-Content "combined.txt"
# Run gource with the combined log file
gource combined.txt --seconds-per-day 0.01