【发布时间】:2017-12-24 19:32:29
【问题描述】:
为什么在下面的代码中,Read-Host 行的输出显示在作业输出之前?
$WorkingDirectory = Get-Location
$ScriptBlockForJob = {
Get-ChildItem $Input -Directory `
| Where-Object `
{$_.GetFiles().Count -eq 0 -and $_.GetDirectories().Count -eq 0} `
| Select-Object FullName
}
Start-Job -InputObject $WorkingDirectory -ScriptBlock $ScriptBlockForJob | Wait-Job | Receive-Job
Read-Host 'Above is a list of empty directories. Press enter to begin deleting them'
【问题讨论】:
标签: powershell scripting