diff options
author | Stuart Preston <stuart@chef.io> | 2018-11-22 12:30:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-22 12:30:35 +0000 |
commit | ca49513fdbdd2b8d964028cf3808838644cd6b10 (patch) | |
tree | 6a7c9b0e5153a4ad23ac19a9166b51f04b135bf4 /lib/chef/resource/windows_share.rb | |
parent | 5c436ac98fd9a5dd78e243616123650217c90419 (diff) | |
parent | 3e66d2629be497172a0a3cb97775f6bcac7c0798 (diff) | |
download | chef-ca49513fdbdd2b8d964028cf3808838644cd6b10.tar.gz |
Merge pull request #7961 from derekgroh/master
windows_share: Avoid ConvertTo-Json errors on Windows 2012r2 with powershell 4
Diffstat (limited to 'lib/chef/resource/windows_share.rb')
-rw-r--r-- | lib/chef/resource/windows_share.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/resource/windows_share.rb b/lib/chef/resource/windows_share.rb index 48fcc9b946..9459146b4c 100644 --- a/lib/chef/resource/windows_share.rb +++ b/lib/chef/resource/windows_share.rb @@ -101,7 +101,7 @@ class Chef # this command selects individual objects because EncryptData & CachingMode have underlying # types that get converted to their Integer values by ConvertTo-Json & we need to make sure # those get written out as strings - share_state_cmd = "Get-SmbShare -Name '#{desired.share_name}' | Select-Object Name,Path, Description, Temporary, CATimeout, ContinuouslyAvailable, ConcurrentUserLimit, EncryptData | ConvertTo-Json" + share_state_cmd = "Get-SmbShare -Name '#{desired.share_name}' | Select-Object Name,Path, Description, Temporary, CATimeout, ContinuouslyAvailable, ConcurrentUserLimit, EncryptData | ConvertTo-Json -Compress" Chef::Log.debug("Running '#{share_state_cmd}' to determine share state'") ps_results = powershell_out(share_state_cmd) @@ -125,7 +125,7 @@ class Chef encrypt_data results["EncryptData"] # folder_enumeration_mode results['FolderEnumerationMode'] - perm_state_cmd = %{Get-SmbShareAccess -Name "#{desired.share_name}" | Select-Object AccountName,AccessControlType,AccessRight | ConvertTo-Json} + perm_state_cmd = %{Get-SmbShareAccess -Name "#{desired.share_name}" | Select-Object AccountName,AccessControlType,AccessRight | ConvertTo-Json -Compress} Chef::Log.debug("Running '#{perm_state_cmd}' to determine share permissions state'") ps_perm_results = powershell_out(perm_state_cmd) |