forked from PoshWeb/4kbMarkdownFiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitialize.ps1
More file actions
49 lines (37 loc) · 1.21 KB
/
initialize.ps1
File metadata and controls
49 lines (37 loc) · 1.21 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Push-Location $PSScriptRoot
if (Test-Path ./TestMarkdown) {
Remove-Item -Recurse -Force ./TestMarkdown
}
$null = New-Item ./TestMarkdown -ItemType Directory -Force
$start = [datetime]::now
$random = [Random]::new()
$jumbled = foreach ($n2 in 1..16) {
@(foreach ($n in 1..4) {
'words', 'in', 'random', 'order' | Get-Random -Count 4
}) | Get-Random -Count 16
}
foreach ($n in 1..4kb) {
@(
"# Markdown file $n"
"* This is test markdown file # $n"
"## Bingo Card"
@(
"|b|i|n|g|o|"
"|-|-|-|-|-|"
foreach ($row in 1..5) {
"|$(@(
foreach ($n in 1..5) {
$random.Next(1,75)
}
) -join '|')|"
}
) -join [Environment]::NewLine
"What follows are $($count = $random.Next(128,256); $count) $(
@('words', 'in', 'random', 'order') * $count | Get-Random -Count (4 * $count)
)"
) -join ([Environment]::NewLine * 2) > "./TestMarkdown/$("{0:d4}" -f $n).md"
}
$end = [DateTime]::now
$took = $end - $start
"4kb Markdown files made in $took"
Pop-Location