This topic contains 8 replies, has 2 voices, and was last updated by
January 6, 2016 at 5:37 am #33535
I'm trying to work out how i can achieve this.
I have one zip file that i want extract and 6 files go in one folder, a different 6 to another.
The files are the same name but change slightly per month as part of a release.
I'll be using the below to unzip the files :
Add-Type -assembly "system.io.compression.filesystem" [io.compression.zipfile]::ExtractToDirectory($Location, $destination)
But how can i move certain files to different locations ? Could i create an XML file ? Or create two hash tables and copy them to required locations ?
XML would be good, but not sure how to go about this.
January 6, 2016 at 11:54 am #33561
In a single unzip operation, you can't send the files to different destinations. You have to unzip them first, and then move them to where you want them.
January 7, 2016 at 6:23 am #33604
OK, thanks Don.
Just for my own reference, could i set directory paths through XML and use powershell to look at the XML and do the copy ? I'm happy i could do this through splatting but interested by the learning the XML way.
January 7, 2016 at 8:49 am #33631
I'm not sure what "the XML way" even is :). I'm not aware of a command that can take an XML file as input to a file copy operation.
January 7, 2016 at 11:53 am #33640
OK Don. My Mistake, thought i could do this sort of thing with XML.
Thanks for your time.
January 7, 2016 at 12:54 pm #33643
Is there something I'm missing? I mean, was there something somewhere you read along those lines? Just because I'm not aware doesn't mean it doesn't exist, so if you've seen something I'd love to have a look!
January 7, 2016 at 1:28 pm #33645
Sorry Don, no i've not seen anything. Just curious to know if it could be done. Thought it could be quite cool ! 🙂
January 7, 2016 at 1:29 pm #33646
Time for you to write a command that does :).
January 7, 2016 at 2:02 pm #33648
Ha ha, Sounds like a challenge, i'll crack on !
The topic ‘one zip file, but certain files to different locations’ is closed to new replies.