You could use the Shell.Application COM object to extract the zip file (works on all versions).
Here's some sample PowerShell. You'd want to parameterize and maybe toss in some error handling, but that should get you going.
$shell = new-object -com shell.application $zip = $shell.NameSpace(“C:\somearchive.zip”) foreach($item in $zip.items()) { $shell.Namespace(“C:\temp\somearchive”).copyhere($item) }
Steve -- Steven Murawski Community Manager @ Chef
On November 21, 2014 at 9:34:20 AM, Brad Knowles (
">
) wrote: On Nov 21, 2014, at 12:30 AM, Dylan K. Grafmyre <
> wrote:
> Use the DSC Archive. However, You need Powershell 4.0 installed on the boxes to use the dsc_script resource which will work on 2008/2012
>
> The last example shows the code for using Archive via dsc_script. https://docs.getchef.com/resource_dsc_script.html
>
> You will need another option for Windows 2003 servers.
The suggestion from the client is to use WinRar, which should give us a solution that will work for both Win2k3 and Win2k8. For the moment, I'm assuming that this is either pre-installed on the machines we're using, or we can install this from an internal company-approved location.
I would prefer to use standard system-provided resources to handle this kind of thing, but I have a stronger preference to use the same solution on all the Windows variants we have to support. I don't mind installing additional tools, so long as they're coming from appropriate security-approved sources.
But is there something else that I'm obviously missing?
Thanks!
--
Brad Knowles <
>
LinkedIn Profile: <http://tinyurl.com/y8kpxu>
|