I am trying to write an advanced function that will grab all files from an archive directory, list them, and total their size so I can see when I’m about to fill up a DVD. Below is a primary piece of script. When I insert this in the process script block by itself, does this mean every object produced by the get-childitem cmdlet is put thru a pipeline? Or just one big object? Is there even a pipeline involved at this point?
If I try to pipe this command to a select-object cmdlet, I can see the specified properties I’ve selected. However, if I then try to pipe to a hash table I get an error message stating:
At line:5 char:12
Expressions are only allowed as the first element of a pipeline.
+ CategoryInfo : ParserError: ( , ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ExpressionsMustBeFirstInPipeline
Get-ChildItem -Path C:\Users\Peter\Documents\Test_Archive -Filter '*.*' -Recurse -file -attributes archiveAny advice? Really getting frustrated. Peter