I am trying to take a zip file that can be in any directory using the gci and $. I am using a foreach to find it, move it, unzip and process the documents before working on the next zip. Still the $ is coming back null. Any suggestions?
I need this powershell to take these zip move them 1 at a time and process them.
find the zip(Works)
2.Move the zip 1 at a time to were the unzip.wsf file can unzip the zip file. (broken)
3.Unzip.wsf unzips file (Works)
3.processes the unzipped files.Works)
Instead of just $, you should specify the property you want. If you change $ to $_.FullName, this should work.
Move-item can take pipeline input, so if you ran just `gci -Path "D:\AR Lockbox Checks*ny*" -Filter “*.zip” | Move-item -destination D:\somepath` you would be good.
But you’re not doing that, you’re calling Move-Item in standalone, so you have to be a bit more specific with the cmdlet, to tell it what you’re trying to do.