Since you’re running a cookbook on a Server 2012 R2 machine, and if you have PowerShell 5.0 installed on that server, you could also use powershell_script in your cookbook with PowerShell 5 cmdlets to create a zip/archive: http://ss64.com/ps/compress-archive.html
Your recipe can use the powershell_script resource if you’re running the cookbook on Windows Server. Since your machine is running Server 2012 R2 it will have PowerShell 4.0 by default. However, you can install PowerShell 5.0 if you wish and take advantage of the native cmdlets to compress an archive (zip file).
Here is an example recipe with PowerShell version logic to use the correct PowerShell script based on version:
powershell_script 'create zip file' do
code <<-EOH
If ($host.version.major -ge "5")
{
Compress-Archive -Path $Folder -DestinationPath $ZipFile
}
ElseIf ($host.version.major -ge "3")
{
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::CreateFromDirectory($Folder, $ZipFile)
}
EOH
end
Also, regarding your “permission denied” problem, you won’t be able to solve it assigning with 777 mode since that command works on Linux machines, not Windows. You’ll need to give the account you’re using on the Windows server proper permissions with Windows commands.