我是powershell的新手,知道为什么会出现错误吗?
Yesterday_Date = (get-date).AddDays(-1).ToString("yyyMMdd")
$jsb={
$file = 'C:\Users\d1\Documents\Batch\path\$Yesterday_Date1\page.log'
Get-Content $file -Wait | ForEach-Object -Begin {
$counter = 1
$lines = @(Get-Content $file).Count
} -Process {
if ($counter++ -gt $lines) {
write-host $_
}
}
}
开始工作 $jsb -name Dum
do{
Receive-Job -Name Dum | out-file C:\Users\path\pager.txt -append
}while(1)