I have been trying out a couple of modules that provide the ability to unzip on
Windows (reidmv/unzip and counsel/puppet-windows).
Both of these work, indeed it would appear using a similar approach (powershell
using .Copyhere). However both of them appear to require that the source zip
file is located on a local drive. The reidmv/unzip README says this :-
source
The fully-qualified path to the zip file to extract. This file must already
exist on the system; that is, it cannot be a remote URL. You can use pget or
another resource
The zip file that I want to use is on a network share (actually while I'm
testing its a sync folder in Vagrant, but will be on a network share when I
move beyond this stage). When I use that location in the source, the module
doesn't fail or error, it just doesn't unzip any of the files. If I move the
file locally it works correctly. The same behaviours is true for the
counsel/puppet-windows module.
Is this a constraint of powershell or is there something else at play here ?
Is there another way that I can unzip a file that is not located on the local
machine (I would prefer not to have to install 7zip or similar if possible, but
I will if that's the only way) ?
Here is the command used in the reidmv/unzip module (it's wrapped into an Exec
resource) :-
exec { "unzip $source to $dest":
command => "\$sh=New-Object -COM
Shell.Application;\$sh.namespace((Convert-Path
'$dest')).Copyhere(\$sh.namespace((Convert-Path '$source')).items(), 16",
creates => $creates,
provider => powershell
}
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/2f5e5e15-36c2-40a8-bde6-444cbb2fa43b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.