Created
December 5, 2020 00:20
-
-
Save scbedd/a611aaeb66cd46bc7814e308cb4fab6d to your computer and use it in GitHub Desktop.
Given a folder, find all readmes with a given suffix in them and supplant existing non-preview readmes with them
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
$targetFolder, | |
$suffix="-pre.md" | |
) | |
Get-ChildItem -Path $targetFolder "*$suffix" | ForEach-Object { | |
Write-Host $_ | |
$NewName = $_.Name.replace($suffix, ".md") | |
$Destination = Join-Path -Path $_.Directory.FullName -ChildPath $NewName | |
Move-Item -Path $_.FullName -Destination $Destination -Force | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment