I have the following simple powershell to extract a zip folder (containing other folders and only log files) to a destination
$FolderPath = "C:\Temp\Whatever"
Expand-Archive -Path "$FolderPath\logs.zip" -DestinationPath "$FolderPath\logs"
Unfortunately this returns a whole bunch of errors like below....
Remove-Item : Cannot find path 'C:\Temp\Whatever\logs\1_Selenium SEPA-Test\Attempt1\1_Start VM's\Release\1_Initialize Agent.log' because it does not exist.
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Archive\Microsoft.PowerShell.Archive.psm1:410 char:46
+ ... $expandedItems | % { Remove-Item $_ -Force -Recurse }
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Temp\Whateve...alize Agent.log:String) [Remove-Item], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
Remove-Item : Cannot find path 'C:\Temp\Whatever\logs\1_Selenium SEPA-Test\Attempt1\1_Start VM's\Release\1_Initialize Job.log' because it does not exist.
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Archive\Microsoft.PowerShell.Archive.psm1:410 char:46
+ ... $expandedItems | % { Remove-Item $_ -Force -Recurse }
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Temp\Whateve...tialize Job.log:String) [Remove-Item], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
and loads of other errors that are similar
I can confirm that the file referenced in the first error C:\Temp\Whatever\logs\1_Selenium SEPA-Test\Attempt1\1_Start VM's\Release\1_Initialize Agent.log
does exist in the zip folder at an equivalent location...
After the script concludes, I do a see an incomplete folder in the directory specified.
Whats going on here?
Thanks,