Hello,
I’m trying really hard to get the hang of Powershell, but I have a hard time sometimes figuring it out…
I have the following situation:
We have a folder structure like this:
G:\Stuff\Logs
Inside the “Logs” folder there are recursive folders like this:
Logs Product Client 2011 01 02 03 2012 01 02 03 2013 01
Etc. Now the idea is with one single script, we want each folder in the year’s folders to be zipped to their own zip file.
But the folder 2018 should not be zipped everything before should.
I have the following code, But I’m stuck on how to get it to zip subfolders recursively…
Get-ChildItem G:\StUF\Log -Depth 3 -Recurse -Directory | Where-Object If (-Not "2018"){Get-ChildItem ....
And somewhere with a “For-Each” statement I imagine it would be:
| Compress-Archive -DestinationPath $Path\$Folder.zip
But I dont want to use absolute paths, it should zip if there is any…
I’m sorry for not being able to explain it too clear…
I’m getting headaches from this stuff… Sorry =X
Thanks in advance!
PS. I’m sorry if it’s not formatted right or the wrong section, I’m new here, but eager to learn! =)
PPS. I’m sorry if this is a double post I feel something went wrong during editting…