chef-powershell 1.0.0 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +3 -23
  3. data/bin/ruby_bin_folder/AMD64/Chef.PowerShell.dll +0 -0
  4. data/bin/ruby_bin_folder/AMD64/Chef.Powershell.Wrapper.dll +0 -0
  5. data/bin/ruby_bin_folder/AMD64/Ijwhost.dll +0 -0
  6. data/bin/ruby_bin_folder/AMD64/concrt140.dll +0 -0
  7. data/bin/ruby_bin_folder/AMD64/host/fxr/5.0.0/hostfxr.dll +0 -0
  8. data/bin/ruby_bin_folder/AMD64/msvcp140.dll +0 -0
  9. data/bin/ruby_bin_folder/AMD64/msvcp140_1.dll +0 -0
  10. data/bin/ruby_bin_folder/AMD64/msvcp140_2.dll +0 -0
  11. data/bin/ruby_bin_folder/AMD64/msvcp140_atomic_wait.dll +0 -0
  12. data/bin/ruby_bin_folder/AMD64/msvcp140_codecvt_ids.dll +0 -0
  13. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll +0 -0
  14. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll +0 -0
  15. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb +0 -0
  16. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Ijwhost.dll +0 -0
  17. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CSharp.dll +0 -0
  18. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.NETCore.App.deps.json +180 -180
  19. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.Core.dll +0 -0
  20. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.dll +0 -0
  21. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Primitives.dll +0 -0
  22. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.dll +0 -0
  23. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Newtonsoft.Json.dll +0 -0
  24. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.AppContext.dll +0 -0
  25. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Buffers.dll +0 -0
  26. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Concurrent.dll +0 -0
  27. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Immutable.dll +0 -0
  28. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.NonGeneric.dll +0 -0
  29. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Specialized.dll +0 -0
  30. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.dll +0 -0
  31. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Annotations.dll +0 -0
  32. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.DataAnnotations.dll +0 -0
  33. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.EventBasedAsync.dll +0 -0
  34. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Primitives.dll +0 -0
  35. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.TypeConverter.dll +0 -0
  36. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.dll +0 -0
  37. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.dll +0 -0
  38. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Console.dll +0 -0
  39. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Core.dll +0 -0
  40. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.Common.dll +0 -0
  41. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.DataSetExtensions.dll +0 -0
  42. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.dll +0 -0
  43. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Contracts.dll +0 -0
  44. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Debug.dll +0 -0
  45. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.DiagnosticSource.dll +0 -0
  46. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.FileVersionInfo.dll +0 -0
  47. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Process.dll +0 -0
  48. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.StackTrace.dll +0 -0
  49. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TextWriterTraceListener.dll +0 -0
  50. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tools.dll +0 -0
  51. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TraceSource.dll +0 -0
  52. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tracing.dll +0 -0
  53. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Primitives.dll +0 -0
  54. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.dll +0 -0
  55. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Dynamic.Runtime.dll +0 -0
  56. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Formats.Asn1.dll +0 -0
  57. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Calendars.dll +0 -0
  58. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Extensions.dll +0 -0
  59. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.dll +0 -0
  60. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.Brotli.dll +0 -0
  61. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.FileSystem.dll +0 -0
  62. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.ZipFile.dll +0 -0
  63. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.dll +0 -0
  64. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.AccessControl.dll +0 -0
  65. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.DriveInfo.dll +0 -0
  66. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Primitives.dll +0 -0
  67. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Watcher.dll +0 -0
  68. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.dll +0 -0
  69. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.IsolatedStorage.dll +0 -0
  70. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.MemoryMappedFiles.dll +0 -0
  71. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.AccessControl.dll +0 -0
  72. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.dll +0 -0
  73. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.UnmanagedMemoryStream.dll +0 -0
  74. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.dll +0 -0
  75. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Expressions.dll +0 -0
  76. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Parallel.dll +0 -0
  77. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Queryable.dll +0 -0
  78. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.dll +0 -0
  79. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Memory.dll +0 -0
  80. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.Json.dll +0 -0
  81. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.dll +0 -0
  82. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.HttpListener.dll +0 -0
  83. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Mail.dll +0 -0
  84. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.NameResolution.dll +0 -0
  85. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.NetworkInformation.dll +0 -0
  86. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Ping.dll +0 -0
  87. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Primitives.dll +0 -0
  88. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Requests.dll +0 -0
  89. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Security.dll +0 -0
  90. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.ServicePoint.dll +0 -0
  91. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Sockets.dll +0 -0
  92. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebClient.dll +0 -0
  93. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebHeaderCollection.dll +0 -0
  94. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebProxy.dll +0 -0
  95. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.Client.dll +0 -0
  96. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.dll +0 -0
  97. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.dll +0 -0
  98. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.Vectors.dll +0 -0
  99. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.dll +0 -0
  100. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ObjectModel.dll +0 -0
  101. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.CoreLib.dll +0 -0
  102. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.DataContractSerialization.dll +0 -0
  103. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Uri.dll +0 -0
  104. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.Linq.dll +0 -0
  105. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.dll +0 -0
  106. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.DispatchProxy.dll +0 -0
  107. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.ILGeneration.dll +0 -0
  108. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.Lightweight.dll +0 -0
  109. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.dll +0 -0
  110. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Extensions.dll +0 -0
  111. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Metadata.dll +0 -0
  112. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Primitives.dll +0 -0
  113. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.TypeExtensions.dll +0 -0
  114. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.dll +0 -0
  115. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Reader.dll +0 -0
  116. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.ResourceManager.dll +0 -0
  117. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Writer.dll +0 -0
  118. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.Unsafe.dll +0 -0
  119. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.VisualC.dll +0 -0
  120. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Extensions.dll +0 -0
  121. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Handles.dll +0 -0
  122. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.RuntimeInformation.dll +0 -0
  123. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.dll +0 -0
  124. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Intrinsics.dll +0 -0
  125. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Loader.dll +0 -0
  126. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Numerics.dll +0 -0
  127. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Formatters.dll +0 -0
  128. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Json.dll +0 -0
  129. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Primitives.dll +0 -0
  130. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Xml.dll +0 -0
  131. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.dll +0 -0
  132. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.dll +0 -0
  133. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.AccessControl.dll +0 -0
  134. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Claims.dll +0 -0
  135. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Algorithms.dll +0 -0
  136. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Cng.dll +0 -0
  137. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Csp.dll +0 -0
  138. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Encoding.dll +0 -0
  139. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.OpenSsl.dll +0 -0
  140. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Primitives.dll +0 -0
  141. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.X509Certificates.dll +0 -0
  142. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.Windows.dll +0 -0
  143. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.dll +0 -0
  144. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.SecureString.dll +0 -0
  145. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.dll +0 -0
  146. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceModel.Web.dll +0 -0
  147. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.dll +0 -0
  148. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.CodePages.dll +0 -0
  149. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.Extensions.dll +0 -0
  150. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.dll +0 -0
  151. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encodings.Web.dll +0 -0
  152. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Json.dll +0 -0
  153. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.RegularExpressions.dll +0 -0
  154. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Channels.dll +0 -0
  155. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Overlapped.dll +0 -0
  156. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Dataflow.dll +0 -0
  157. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Extensions.dll +0 -0
  158. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Parallel.dll +0 -0
  159. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.dll +0 -0
  160. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Thread.dll +0 -0
  161. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.ThreadPool.dll +0 -0
  162. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Timer.dll +0 -0
  163. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.dll +0 -0
  164. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.Local.dll +0 -0
  165. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.dll +0 -0
  166. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ValueTuple.dll +0 -0
  167. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Web.HttpUtility.dll +0 -0
  168. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Web.dll +0 -0
  169. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Windows.dll +0 -0
  170. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Linq.dll +0 -0
  171. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.ReaderWriter.dll +0 -0
  172. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Serialization.dll +0 -0
  173. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XDocument.dll +0 -0
  174. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.XDocument.dll +0 -0
  175. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.dll +0 -0
  176. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlDocument.dll +0 -0
  177. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlSerializer.dll +0 -0
  178. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.dll +0 -0
  179. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.dll +0 -0
  180. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/WindowsBase.dll +0 -0
  181. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clrcompression.dll +0 -0
  182. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clretwrc.dll +0 -0
  183. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clrjit.dll +0 -0
  184. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/coreclr.dll +0 -0
  185. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/createdump.exe +0 -0
  186. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/dbgshim.dll +0 -0
  187. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/hostfxr.dll +0 -0
  188. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/hostpolicy.dll +0 -0
  189. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore.dll +0 -0
  190. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore_amd64_amd64_5.0.521.16609.dll +0 -0
  191. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordbi.dll +0 -0
  192. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscorlib.dll +0 -0
  193. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscorrc.dll +0 -0
  194. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/netstandard.dll +0 -0
  195. data/bin/ruby_bin_folder/AMD64/vccorlib140.dll +0 -0
  196. data/bin/ruby_bin_folder/AMD64/vcruntime140.dll +0 -0
  197. data/bin/ruby_bin_folder/AMD64/vcruntime140_1.dll +0 -0
  198. data/bin/ruby_bin_folder/x86/Chef.PowerShell.dll +0 -0
  199. data/bin/ruby_bin_folder/x86/Chef.Powershell.Wrapper.dll +0 -0
  200. data/bin/ruby_bin_folder/x86/concrt140.dll +0 -0
  201. data/bin/ruby_bin_folder/x86/msvcp140.dll +0 -0
  202. data/bin/ruby_bin_folder/x86/msvcp140_1.dll +0 -0
  203. data/bin/ruby_bin_folder/x86/msvcp140_2.dll +0 -0
  204. data/bin/ruby_bin_folder/x86/msvcp140_atomic_wait.dll +0 -0
  205. data/bin/ruby_bin_folder/x86/msvcp140_codecvt_ids.dll +0 -0
  206. data/bin/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll +0 -0
  207. data/bin/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll +0 -0
  208. data/bin/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb +0 -0
  209. data/bin/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Newtonsoft.Json.dll +0 -0
  210. data/bin/ruby_bin_folder/x86/vccorlib140.dll +0 -0
  211. data/bin/ruby_bin_folder/x86/vcruntime140.dll +0 -0
  212. data/chef-powershell.gemspec +52 -52
  213. data/lib/chef-powershell/exceptions.rb +26 -26
  214. data/lib/chef-powershell/json_compat.rb +3 -3
  215. data/lib/chef-powershell/powershell.rb +41 -20
  216. data/lib/chef-powershell/powershell_exec.rb +10 -9
  217. data/lib/chef-powershell/pwsh.rb +9 -5
  218. data/lib/chef-powershell/version.rb +20 -20
  219. data/lib/chef-powershell.rb +1 -1
  220. data/spec/unit/powershell_exec_spec.rb +16 -11
  221. metadata +18 -20
  222. data/bin/powershell/chef/chef.psm1 +0 -459
  223. data/bin/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dll +0 -0
  224. data/bin/ruby_bin_folder/AMD64/canary.txt +0 -1
  225. data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore_amd64_amd64_5.0.20.51904.dll +0 -0
@@ -1,52 +1,52 @@
1
- # frozen_string_literal: true
2
- lib = File.expand_path("lib", __dir__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- bin = File.expand_path("bin", __dir__)
5
- $LOAD_PATH.unshift(bin) unless $LOAD_PATH.include?(bin)
6
- require "chef-powershell/version"
7
-
8
- Gem::Specification.new do |spec|
9
- spec.name = "chef-powershell"
10
- spec.version = ChefPowerShell::VERSION
11
- spec.authors = ["Chef Software, Inc"]
12
- spec.email = ["oss@chef.io"]
13
-
14
- spec.summary = %q{Extneral module for accessing and utilizing PowerShell}
15
- spec.homepage = "https://github.com/chef/chef/tree/main/chef-powershell"
16
- spec.license = "Apache-2.0"
17
-
18
- spec.required_ruby_version = ">= 2.6"
19
-
20
- spec.add_runtime_dependency "ffi"
21
- spec.add_runtime_dependency "ffi-yajl"
22
-
23
- spec.metadata = {
24
- "bug_tracker_uri" => "https://github.com/chef/chef/issues",
25
- "changelog_uri" => "https://github.com/chef/chef/blob/main/CHANGELOG.md",
26
- "documentation_uri" => "https://github.com/chef/chef/tree/main/chef-powershell/README.md",
27
- "homepage_uri" => "https://github.com/chef/chef/tree/main/chef-powershell",
28
- "source_code_uri" => "https://github.com/chef/chef/tree/main/chef-powershell",
29
- }
30
-
31
- spec.require_paths = %w{lib bin}
32
-
33
- #
34
- # NOTE: DO NOT ADD RUNTIME DEPS TO OTHER CHEF ECOSYSTEM GEMS
35
- # (e.g. chef, ohai, mixlib-anything, ffi-yajl, and IN PARTICULAR NOT chef-config)
36
- #
37
- # This is so that this set of common code can be reused in any other library without
38
- # creating circular dependencies. If you find yourself wanting to do that you probably
39
- # have a helper that should go into the library you want to declare a dependency on,
40
- # or you need to create another gem that is not this one. You may also want to rub some
41
- # dependency injection on your API to invert things so that you don't have to take
42
- # a dependency on the thing you need (i.e. allow injecting a hash-like thing instead of taking
43
- # a dep on mixlib-config and then require the consumer to wire up chef-config to your
44
- # API). Same for mixlib-log and Chef::Log in general.
45
- #
46
- # ABSOLUTELY NO EXCEPTIONS
47
- #
48
- spec.bindir = "bin"
49
- spec.executables = []
50
- spec.files = %w{Rakefile LICENSE} + Dir.glob("*.gemspec") +
51
- Dir.glob("{lib,spec,bin}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) }
52
- end
1
+ # frozen_string_literal: true
2
+ lib = File.expand_path("lib", __dir__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ bin = File.expand_path("bin", __dir__)
5
+ $LOAD_PATH.unshift(bin) unless $LOAD_PATH.include?(bin)
6
+ require "chef-powershell/version"
7
+
8
+ Gem::Specification.new do |spec|
9
+ spec.name = "chef-powershell"
10
+ spec.version = ChefPowerShell::VERSION
11
+ spec.authors = ["Chef Software, Inc"]
12
+ spec.email = ["oss@chef.io"]
13
+
14
+ spec.summary = %q{External Chef module for accessing and utilizing PowerShell}
15
+ spec.homepage = "https://github.com/chef/chef-powershell-shim"
16
+ spec.license = "Apache-2.0"
17
+
18
+ spec.required_ruby_version = ">= 2.6"
19
+
20
+ spec.add_runtime_dependency "ffi", "~> 1.15"
21
+ spec.add_runtime_dependency "ffi-yajl", "~> 2.4"
22
+
23
+ spec.metadata = {
24
+ "bug_tracker_uri" => "https://github.com/chef/chef/issues",
25
+ "changelog_uri" => "https://github.com/chef/chef-powershell-shim/CHANGELOG.md",
26
+ "documentation_uri" => "https://github.com/chef/chef-powershell-shim/chef-powershell/README.md",
27
+ "homepage_uri" => "https://github.com/chef/chef/tree/main/chef-powershell",
28
+ "source_code_uri" => "https://github.com/chef/chef-powershell-shim/chef-powershell",
29
+ }
30
+
31
+ spec.require_paths = %w{lib bin}
32
+
33
+ #
34
+ # NOTE: DO NOT ADD RUNTIME DEPS TO OTHER CHEF ECOSYSTEM GEMS
35
+ # (e.g. chef, ohai, mixlib-anything, ffi-yajl, and IN PARTICULAR NOT chef-config)
36
+ #
37
+ # This is so that this set of common code can be reused in any other library without
38
+ # creating circular dependencies. If you find yourself wanting to do that you probably
39
+ # have a helper that should go into the library you want to declare a dependency on,
40
+ # or you need to create another gem that is not this one. You may also want to rub some
41
+ # dependency injection on your API to invert things so that you don't have to take
42
+ # a dependency on the thing you need (i.e. allow injecting a hash-like thing instead of taking
43
+ # a dep on mixlib-config and then require the consumer to wire up chef-config to your
44
+ # API). Same for mixlib-log and Chef::Log in general.
45
+ #
46
+ # ABSOLUTELY NO EXCEPTIONS
47
+ #
48
+ spec.bindir = "bin"
49
+ spec.executables = []
50
+ spec.files = %w{Rakefile LICENSE} + Dir.glob("*.gemspec") +
51
+ Dir.glob("{lib,spec,bin}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) }
52
+ end
@@ -1,27 +1,27 @@
1
- #
2
- # Author:: John McCrae (<john.mccrae@progress.com>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
-
18
- class Chef_PowerShell
19
- class PowerShellExceptions
20
- class PowerShellCommandFailed < RuntimeError; end
21
-
22
- class JSON
23
- class EncodeError < RuntimeError; end
24
- class ParseError < RuntimeError; end
25
- end
26
- end
1
+ #
2
+ # Author:: John McCrae (<john.mccrae@progress.com>)
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ class Chef_PowerShell
19
+ class PowerShellExceptions
20
+ class PowerShellCommandFailed < RuntimeError; end
21
+
22
+ class JSON
23
+ class EncodeError < RuntimeError; end
24
+ class ParseError < RuntimeError; end
25
+ end
26
+ end
27
27
  end
@@ -30,7 +30,7 @@ class Chef
30
30
  def parse(source, opts = {})
31
31
  FFI_Yajl::Parser.parse(source, opts)
32
32
  rescue FFI_Yajl::ParseError => e
33
- raise Chef::PowerShellExceptions::JSON::ParseError, e.message
33
+ raise Chef_PowerShell::PowerShellExceptions::JSON::ParseError, e.message
34
34
  end
35
35
 
36
36
  def from_json(source, opts = {})
@@ -40,7 +40,7 @@ class Chef
40
40
  # you get the "must contain two octets" error). Yajl doesn't impose the
41
41
  # same limitation. For compatibility, we re-impose this condition.
42
42
  unless obj.is_a?(Hash) || obj.is_a?(Array)
43
- raise Chef::PowerShellExceptions::JSON::ParseError, "Top level JSON object must be a Hash or Array. (actual: #{obj.class})"
43
+ raise Chef_PowerShell::PowerShellExceptions::JSON::ParseError, "Top level JSON object must be a Hash or Array. (actual: #{obj.class})"
44
44
  end
45
45
 
46
46
  obj
@@ -49,7 +49,7 @@ class Chef
49
49
  def to_json(obj, opts = nil)
50
50
  FFI_Yajl::Encoder.encode(obj, opts)
51
51
  rescue FFI_Yajl::EncodeError => e
52
- raise Chef::PowerShellExceptions::JSON::EncodeError, e.message
52
+ raise Chef_PowerShell::PowerShellExceptions::JSON::EncodeError, e.message
53
53
  end
54
54
 
55
55
  def to_json_pretty(obj, opts = nil)
@@ -19,11 +19,10 @@ require "ffi" unless defined?(FFI)
19
19
  require_relative "json_compat"
20
20
  require_relative "exceptions"
21
21
  require_relative "unicode"
22
- require "chef-powershell"
22
+ # require "chef-powershell"
23
23
 
24
24
  class Chef_PowerShell
25
25
  class PowerShell
26
- extend FFI::Library
27
26
 
28
27
  attr_reader :result
29
28
  attr_reader :errors
@@ -36,16 +35,15 @@ class Chef_PowerShell
36
35
  # Requires: .NET Framework 4.0 or higher on the target machine.
37
36
  #
38
37
  # @param script [String] script to run
38
+ # @param timeout [Integer, nil] timeout in seconds.
39
39
  # @return [Object] output
40
- def initialize(script)
40
+ def initialize(script, timeout: -1)
41
41
  # This Powershell DLL source lives here: https://github.com/chef/chef-powershell-shim
42
- # Every merge into that repo triggers a Habitat build and promotion. Running
43
- # the rake :update_chef_exec_dll task in this (chef/chef) repo will pull down
44
- # the built packages and copy the binaries to chef-powershell/bin/ruby_bin_folder. Bundle install
45
- # ensures that the correct architecture binaries are installed into the path.
46
- powershell_dll = Gem.loaded_specs["chef-powershell"].full_gem_path + "/bin/ruby_bin_folder/#{ENV["PROCESSOR_ARCHITECTURE"]}/Chef.PowerShell.Wrapper.dll"
47
- @dll ||= powershell_dll
48
- exec(script)
42
+ # Every merge into that repo triggers a Habitat build and verification process.
43
+ # There is no mechanism to build a Windows gem file. It has to be done manually running manual_gem_release.ps1
44
+ # Bundle install ensures that the correct architecture binaries are installed into the path.
45
+ @powershell_dll = Gem.loaded_specs["chef-powershell"].full_gem_path + "/bin/ruby_bin_folder/#{ENV["PROCESSOR_ARCHITECTURE"]}/Chef.PowerShell.Wrapper.dll"
46
+ exec(script, timeout: timeout)
49
47
  end
50
48
 
51
49
  #
@@ -60,24 +58,47 @@ class Chef_PowerShell
60
58
  end
61
59
 
62
60
  #
63
- # @raise [Chef::ChefPowerShell::CommandFailed] raise if the command failed
61
+ # @raise [Chef_PowerShell::PowerShellExceptions::PowerShellCommandFailed] raise if the command failed
64
62
  #
65
63
  def error!
66
64
  raise Chef_PowerShell::PowerShellExceptions::PowerShellCommandFailed, "Unexpected exit in PowerShell command: #{@errors}" if error?
67
65
  end
68
66
 
69
- # protected
70
- private
67
+ module PowerMod
68
+ extend FFI::Library
69
+ @@powershell_dll = Gem.loaded_specs["chef-powershell"].full_gem_path + "/bin/ruby_bin_folder/#{ENV["PROCESSOR_ARCHITECTURE"]}/Chef.PowerShell.Wrapper.dll"
70
+ @@ps_command = ""
71
+ @@ps_timeout = -1
72
+
73
+ def self.set_ps_dll(value)
74
+ @@powershell_dll = value
75
+ end
76
+
77
+ def self.set_ps_command(value)
78
+ @@ps_command = value
79
+ end
71
80
 
72
- def self.attach(dll, script)
73
- ffi_lib dll
74
- attach_function :execute_powershell, :ExecuteScript, [:string], :pointer
81
+ def self.set_ps_timeout(value)
82
+ @@ps_timeout = value
83
+ end
84
+
85
+ def self.do_work
86
+ ffi_lib @@powershell_dll
87
+ attach_function :execute_powershell, :ExecuteScript, %i{string int}, :pointer
88
+ execute_powershell(@@ps_command, @@ps_timeout)
89
+ end
75
90
  end
76
91
 
77
- def exec(script)
78
- self.class.attach(@dll, script)
79
- execution = execute_powershell(script).read_utf16string
80
- hashed_outcome = Chef::JSONCompat.parse(execution)
92
+ private
93
+
94
+ def exec(script, timeout: -1)
95
+ timeout = -1 if timeout == 0 || timeout.nil?
96
+ PowerMod.set_ps_dll(@powershell_dll)
97
+ PowerMod.set_ps_timeout(timeout)
98
+ PowerMod.set_ps_command(script)
99
+ execution = PowerMod.do_work
100
+ output = execution.read_utf16string
101
+ hashed_outcome = Chef::JSONCompat.parse(output)
81
102
  @result = Chef::JSONCompat.parse(hashed_outcome["result"])
82
103
  @errors = hashed_outcome["errors"]
83
104
  @verbose = hashed_outcome["verbose"]
@@ -18,12 +18,12 @@
18
18
  require_relative "./powershell"
19
19
  require_relative "./pwsh"
20
20
 
21
- # The powershell_exec mixin provides in-process access to the PowerShell engine.
21
+ # The Chef-PowerShell gem provides in-process access to the PowerShell engine.
22
22
  #
23
23
  # powershell_exec is initialized with a string that should be set to the script
24
24
  # to run and also takes an optional interpreter argument which must be either
25
25
  # :powershell (Windows PowerShell which is the default) or :pwsh (PowerShell
26
- # Core). It will return a Chef::PowerShell object that provides 5 methods:
26
+ # Core). It will return a Chef_PowerShell::PowerShell object that provides 5 methods:
27
27
  #
28
28
  # .result - returns a hash representing the results returned by executing the
29
29
  # PowerShell script block
@@ -97,7 +97,7 @@ require_relative "./pwsh"
97
97
 
98
98
  class Chef_PowerShell
99
99
  module ChefPowerShell
100
- module PowershellExec
100
+ module PowerShellExec
101
101
  # The Chef.PowerShell.Wrapper.dll file looks in the same folder as ruby.exe OR in the folder specified by the environment variable CHEF_POWERSHELL_BIN for other chef powershell dll's
102
102
  # We don't want to move files around so we're setting the variable here to keep everything tidy.
103
103
  file_path = Gem.loaded_specs["chef-powershell"].full_gem_path + "/bin/ruby_bin_folder/#{ENV["PROCESSOR_ARCHITECTURE"]}/"
@@ -108,22 +108,23 @@ class Chef_PowerShell
108
108
  #
109
109
  # @param script [String] script to run
110
110
  # @param interpreter [Symbol] the interpreter type, `:powershell` or `:pwsh`
111
+ # @param timeout [Integer, nil] timeout in seconds.
111
112
  # @return [Chef::PowerShell] output
112
- def powershell_exec(script, interpreter = :powershell)
113
+ def powershell_exec(script, interpreter = :powershell, timeout: -1)
113
114
  case interpreter
114
115
  when :powershell
115
- Chef_PowerShell::PowerShell.new(script)
116
+ Chef_PowerShell::PowerShell.new(script, timeout: timeout)
116
117
  when :pwsh
117
- Chef_PowerShell::Pwsh.new(script)
118
+ Chef_PowerShell::Pwsh.new(script, timeout: timeout)
118
119
  else
119
120
  raise ArgumentError, "Expected interpreter of :powershell or :pwsh"
120
121
  end
121
122
  end
122
123
 
123
124
  # The same as the #powershell_exec method except this will raise
124
- # Chef::PowerShell::CommandFailed if the command fails
125
- def powershell_exec!(script, interpreter = :powershell)
126
- cmd = powershell_exec(script, interpreter)
125
+ # Chef_PowerShell::PowerShellExceptions::PowerShellCommandFailed if the command fails
126
+ def powershell_exec!(script, interpreter = :powershell, **options)
127
+ cmd = powershell_exec(script, interpreter, **options)
127
128
  cmd.error!
128
129
  cmd
129
130
  end
@@ -23,15 +23,16 @@ class Chef_PowerShell
23
23
  # bindir directory.
24
24
  #
25
25
  # @param script [String] script to run
26
+ # @param timeout [Integer, nil] timeout in seconds.
26
27
  # @return [Object] output
27
- def initialize(script)
28
+ def initialize(script, timeout: -1)
28
29
  @dll = Pwsh.dll
29
30
  super
30
31
  end
31
32
 
32
33
  protected
33
34
 
34
- def exec(script)
35
+ def exec(script, timeout: -1)
35
36
  # Note that we need to override the location of the shared dotnet core library
36
37
  # location. With most .net core applications, you can simply publish them as a
37
38
  # "self-contained" application allowing consumers of the application to run them
@@ -46,8 +47,10 @@ class Chef_PowerShell
46
47
  original_dotnet_root_x86 = ENV["DOTNET_ROOT(x86)"]
47
48
 
48
49
  ENV["DOTNET_MULTILEVEL_LOOKUP"] = "0"
49
- ENV["DOTNET_ROOT"] = RbConfig::CONFIG["bindir"]
50
- ENV["DOTNET_ROOT(x86)"] = RbConfig::CONFIG["bindir"]
50
+ ENV["DOTNET_ROOT"] = Gem.loaded_specs["chef-powershell"].full_gem_path + "/bin/ruby_bin_folder/AMD64"
51
+ ENV["DOTNET_ROOT(x86)"] = Gem.loaded_specs["chef-powershell"].full_gem_path + "/bin/ruby_bin_folder/x86"
52
+
53
+ @powershell_dll = Gem.loaded_specs["chef-powershell"].full_gem_path + "/bin/ruby_bin_folder/#{ENV["PROCESSOR_ARCHITECTURE"]}/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll"
51
54
 
52
55
  super
53
56
  ensure
@@ -64,7 +67,8 @@ class Chef_PowerShell
64
67
  # ensures that the correct architecture binaries are installed into the path.
65
68
  # Also note that the version of pwsh is determined by which assemblies the dll was
66
69
  # built with. To update powershell, those dependencies must be bumped.
67
- @dll ||= Dir.glob("#{RbConfig::CONFIG["bindir"]}/**/Chef.PowerShell.Wrapper.Core.dll").last
70
+ @powershell_dll = Gem.loaded_specs["chef-powershell"].full_gem_path + "/bin/ruby_bin_folder/#{ENV["PROCESSOR_ARCHITECTURE"]}/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll"
71
+ @dll ||= @powershell_dll
68
72
  end
69
73
  end
70
74
  end
@@ -1,20 +1,20 @@
1
- # frozen_string_literal: true
2
- # Copyright:: Copyright (c) Chef Software Inc.
3
- # License:: Apache License, Version 2.0
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- module ChefPowerShell
18
- CHEFPOWERSHELL_ROOT = File.expand_path("..", __dir__)
19
- VERSION = "1.0.0"
20
- end
1
+ # frozen_string_literal: true
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ module ChefPowerShell
18
+ CHEFPOWERSHELL_ROOT = File.expand_path("..", __dir__)
19
+ VERSION = "1.0.7"
20
+ end
@@ -19,5 +19,5 @@
19
19
  require_relative "chef-powershell/powershell_exec"
20
20
 
21
21
  module ChefPowerShell
22
- include Chef_PowerShell::ChefPowerShell::PowershellExec
22
+ include Chef_PowerShell::ChefPowerShell::PowerShellExec
23
23
  end
@@ -18,40 +18,45 @@
18
18
 
19
19
  require "chef-powershell"
20
20
 
21
- describe Chef_PowerShell::ChefPowerShell::PowershellExec, :windows_only do
22
- let(:powershell_mixin) { Class.new { include Chef_PowerShell::ChefPowerShell::PowershellExec } }
21
+ describe Chef_PowerShell::ChefPowerShell::PowerShellExec, :windows_only do
22
+ let(:powershell_mixin) { Class.new { include Chef_PowerShell::ChefPowerShell::PowerShellExec } }
23
23
  subject(:object) { powershell_mixin.new }
24
24
 
25
+ before do
26
+ file_path = Gem.loaded_specs["chef-powershell"].full_gem_path + "/bin/ruby_bin_folder/#{ENV["PROCESSOR_ARCHITECTURE"]}/"
27
+ ENV["CHEF_POWERSHELL_BIN"] = file_path
28
+ end
29
+
25
30
  describe "#powershell_exec" do
26
31
  context "not specifying an interpreter" do
27
32
  it "runs a basic command and returns a Chef::PowerShell object" do
28
- expect(object.powershell_exec("$PSVersionTable")).to be_kind_of(Chef_PowerShell::PowerShell)
33
+ expect(object.powershell_exec("$PSVersionTable", :powershell, timeout: -1)).to be_kind_of(Chef_PowerShell::PowerShell)
29
34
  end
30
35
 
31
- it "uses less than version 6" do
32
- execution = object.powershell_exec("$PSVersionTable")
33
- expect(execution.result["PSVersion"].to_s.to_i).to be < 6
36
+ it "uses less than version 7" do
37
+ execution = object.powershell_exec("$PSVersionTable", :powershell, timeout: -1)
38
+ expect(execution.result["PSVersion"].to_s.to_i).to be < 7
34
39
  end
35
40
  end
36
41
 
37
42
  context "using pwsh interpreter" do
38
43
  it "runs a basic command and returns a Chef::PowerShell object" do
39
- expect(object.powershell_exec("$PSVersionTable", :pwsh)).to be_kind_of(Chef_PowerShell::Pwsh)
44
+ expect(object.powershell_exec("$PSVersionTable", :pwsh, timeout: -1)).to be_kind_of(Chef_PowerShell::Pwsh)
40
45
  end
41
46
 
42
47
  it "uses greater than version 6" do
43
- execution = object.powershell_exec("$PSVersionTable", :pwsh)
48
+ execution = object.powershell_exec("$PSVersionTable", :pwsh, timeout: -1)
44
49
  expect(execution.result["PSVersion"]["Major"]).to be >= 7
45
50
  end
46
51
  end
47
52
 
48
53
  context "using powershell interpreter" do
49
54
  it "runs a basic command and returns a Chef::PowerShell object" do
50
- expect(object.powershell_exec("$PSVersionTable", :powershell)).to be_kind_of(Chef_PowerShell::PowerShell)
55
+ expect(object.powershell_exec("$PSVersionTable", :powershell, timeout: -1)).to be_kind_of(Chef_PowerShell::PowerShell)
51
56
  end
52
57
 
53
58
  it "uses less than version 6" do
54
- execution = object.powershell_exec("$PSVersionTable", :powershell)
59
+ execution = object.powershell_exec("$PSVersionTable", :powershell, timeout: -1)
55
60
  expect(execution.result["PSVersion"].to_s.to_i).to be < 6
56
61
  end
57
62
  end
@@ -75,7 +80,7 @@ describe Chef_PowerShell::ChefPowerShell::PowershellExec, :windows_only do
75
80
 
76
81
  describe "#powershell_exec!" do
77
82
  it "runs a basic command and returns a Chef::PowerShell object" do
78
- expect(object.powershell_exec!("$PSVersionTable")).to be_kind_of(Chef_PowerShell::PowerShell)
83
+ expect(object.powershell_exec!("$PSVersionTable", :powershell, timeout: -1)).to be_kind_of(Chef_PowerShell::PowerShell)
79
84
  end
80
85
 
81
86
  it "raises an error if the command fails" do
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-powershell
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-26 00:00:00.000000000 Z
11
+ date: 2022-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '1.15'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '1.15'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ffi-yajl
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '2.4'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '2.4'
41
41
  description:
42
42
  email:
43
43
  - oss@chef.io
@@ -47,12 +47,10 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - LICENSE
49
49
  - Rakefile
50
- - bin/powershell/chef/chef.psm1
51
- - bin/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dll
52
50
  - bin/ruby_bin_folder/AMD64/Chef.PowerShell.dll
51
+ - bin/ruby_bin_folder/AMD64/Chef.Powershell.Wrapper.dll
53
52
  - bin/ruby_bin_folder/AMD64/Ijwhost.dll
54
53
  - bin/ruby_bin_folder/AMD64/Newtonsoft.Json.dll
55
- - bin/ruby_bin_folder/AMD64/canary.txt
56
54
  - bin/ruby_bin_folder/AMD64/concrt140.dll
57
55
  - bin/ruby_bin_folder/AMD64/host/fxr/5.0.0/hostfxr.dll
58
56
  - bin/ruby_bin_folder/AMD64/msvcp140.dll
@@ -331,7 +329,7 @@ files:
331
329
  - bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mi.dll
332
330
  - bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/miutils.dll
333
331
  - bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore.dll
334
- - bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore_amd64_amd64_5.0.20.51904.dll
332
+ - bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore_amd64_amd64_5.0.521.16609.dll
335
333
  - bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordbi.dll
336
334
  - bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscorlib.dll
337
335
  - bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscorrc.dll
@@ -668,15 +666,15 @@ files:
668
666
  - lib/chef-powershell/version.rb
669
667
  - lib/chef-powershell/wide_string.rb
670
668
  - spec/unit/powershell_exec_spec.rb
671
- homepage: https://github.com/chef/chef/tree/main/chef-powershell
669
+ homepage: https://github.com/chef/chef-powershell-shim
672
670
  licenses:
673
671
  - Apache-2.0
674
672
  metadata:
675
673
  bug_tracker_uri: https://github.com/chef/chef/issues
676
- changelog_uri: https://github.com/chef/chef/blob/main/CHANGELOG.md
677
- documentation_uri: https://github.com/chef/chef/tree/main/chef-powershell/README.md
674
+ changelog_uri: https://github.com/chef/chef-powershell-shim/CHANGELOG.md
675
+ documentation_uri: https://github.com/chef/chef-powershell-shim/chef-powershell/README.md
678
676
  homepage_uri: https://github.com/chef/chef/tree/main/chef-powershell
679
- source_code_uri: https://github.com/chef/chef/tree/main/chef-powershell
677
+ source_code_uri: https://github.com/chef/chef-powershell-shim/chef-powershell
680
678
  post_install_message:
681
679
  rdoc_options: []
682
680
  require_paths:
@@ -693,8 +691,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
693
691
  - !ruby/object:Gem::Version
694
692
  version: '0'
695
693
  requirements: []
696
- rubygems_version: 3.2.29
694
+ rubygems_version: 3.2.22
697
695
  signing_key:
698
696
  specification_version: 4
699
- summary: Extneral module for accessing and utilizing PowerShell
697
+ summary: External Chef module for accessing and utilizing PowerShell
700
698
  test_files: []