Score:0

How to ensure a zipped folder no longer contains a deleted file after it is unzipped to another folder?

us flag

I am new to Powershell and I am encountering a problem. I have two File Paths containing the two folders that I need to perform my Task. For example,

folderA = D:\Deployment\Packages\FileA

folderB= E:\Directories\FileB

FileA is a zipped file that has many other sub file directors and it will be unzipped later in the function to the location in File B. My issue currently is that when I delete a file in FileA, it will not update the file contents and when it is copied to FileB, the deleted file would still exist. The question is, how would I go about doing a code clean up to ensure that before FileA is unzipped, it will ensure that the deleted files will no longer exist?

To illustrate:

folderA = D:\Deployment\Packages\FileA

FileA Sub-directories:

bin docs test test2 test3 (e.g. I delete this file)

FileB (Destination folder where I would unzip FileA and the expected outcome)

bin docs test test2

Thus, I need a function or a code clean up that will ensure that before FileA is unzipped and copied/moved to FileB, the deleted file should no longer exist. Thus, in the example above, the test3 folder should not be found anymore. Thank you, help would be appreciated.

DarkMoon avatar
in flag
Why would you not create the zipfile after doing what you need to in FolderA? Make FolderA be what you want, zip it up, copy it to FolderB, then unzip?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.