Skip to content

Commit 08c9627

Browse files
feat: build.with.powershell.foreach-object ( Fixes #9 )
1 parent a3c15c4 commit 08c9627

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
param(
2+
[Alias('Input')]
3+
[string]
4+
$InputPath = "$psScriptRoot/TestMarkdown",
5+
6+
[string]
7+
$OutputPath = "$psScriptRoot/PowerShellForeachObject"
8+
)
9+
10+
11+
Get-ChildItem -Path $InputPath -File |
12+
Foreach-Object {
13+
$in = $_
14+
New-Item -ItemType File -Path (
15+
Join-Path $OutputPath ($in.Name -replace '\.md$') |
16+
Join-Path -ChildPath ./index.html
17+
) -Value (
18+
($in |
19+
ConvertFrom-Markdown |
20+
Select-Object -ExpandProperty html)
21+
) -Force
22+
}

0 commit comments

Comments
 (0)