What is $_?

You probably meant to use $Line there.

And you probably want to skip entries that are blank.

-----Original Message-----
From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On 
Behalf Of Kurt Buff
Sent: Friday, January 5, 2018 6:27 PM
To: powershell@lists.myitforum.com
Subject: [powershell] Two questions in one? Score!

Hi all,

Very simple, and almost certainly obvious to you guys what I'm doing
wrong, but first a question about Get-DFSRBacklog: Why am I seeing
blank lines in the output for this cmdlet? Anyone have a clue on that?
The output is always the same for this cmdlet - that is, if I run the
script several times in a short period of time, the blank lines show
up in the same place in the output.

Regardless, I do get data stuffed into $DFSRBacklog.

Here's my script:

$DFSRBacklog = Get-DfsrBacklog -SourceComputerName server1
-DestinationComputerName server2 | Select -expand FullPathName
$DFSRBacklogListing = ForEach ( $Line in $DFSRBacklog )
   {
      gci $_ | Select FullName,Size,LastWriteTime
    }

When I run this script, it hangs, and I don't get any data in
$DFSRBacklogListing - but if I break out of it, the data I expect in
$DFSRBacklog is present.

Kurt




Reply via email to