use Get-ChildItem with excluded files instead of dir

This commit is contained in:
David Refoua 2022-10-15 00:20:58 +03:30 committed by GitHub
parent 50816c6bfc
commit f02bbfc5be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,8 @@ $version = Get-VersionStr
if ($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent) {
Write-Verbose "Packing Cmder $version in $saveTo..."
dir $cmderRoot
$excluded = (Get-Content -Path "$cmderRoot\packignore") -Split [System.Environment]::NewLine | Where-Object {$_}
Get-ChildItem $cmderRoot -Recurse -Force -Exclude $excluded
}
foreach ($t in $targets.GetEnumerator()) {