chef-powershell 1.0.0 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +3 -23
- data/bin/ruby_bin_folder/AMD64/Chef.PowerShell.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/Chef.Powershell.Wrapper.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/Ijwhost.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/concrt140.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/host/fxr/5.0.0/hostfxr.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/msvcp140.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/msvcp140_1.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/msvcp140_2.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/msvcp140_atomic_wait.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/msvcp140_codecvt_ids.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Ijwhost.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.CSharp.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.NETCore.App.deps.json +180 -180
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.Core.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.VisualBasic.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Primitives.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.Win32.Registry.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Newtonsoft.Json.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.AppContext.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Buffers.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Concurrent.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Immutable.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.NonGeneric.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.Specialized.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Collections.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Annotations.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.DataAnnotations.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.EventBasedAsync.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.Primitives.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.TypeConverter.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ComponentModel.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Configuration.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Console.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Core.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.Common.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.DataSetExtensions.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Data.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Contracts.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Debug.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.DiagnosticSource.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.FileVersionInfo.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Process.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.StackTrace.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TextWriterTraceListener.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tools.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.TraceSource.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Tracing.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Primitives.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Dynamic.Runtime.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Formats.Asn1.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Calendars.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.Extensions.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Globalization.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.Brotli.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.FileSystem.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.ZipFile.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Compression.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.AccessControl.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.DriveInfo.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Primitives.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.Watcher.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.FileSystem.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.IsolatedStorage.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.MemoryMappedFiles.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.AccessControl.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.Pipes.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.UnmanagedMemoryStream.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.IO.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Expressions.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Parallel.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.Queryable.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Linq.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Memory.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.Json.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Http.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.HttpListener.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Mail.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.NameResolution.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.NetworkInformation.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Ping.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Primitives.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Requests.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Security.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.ServicePoint.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.Sockets.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebClient.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebHeaderCollection.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebProxy.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.Client.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.WebSockets.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Net.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.Vectors.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Numerics.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ObjectModel.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.CoreLib.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.DataContractSerialization.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Uri.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.Linq.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Private.Xml.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.DispatchProxy.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.ILGeneration.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.Lightweight.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Emit.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Extensions.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Metadata.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.Primitives.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.TypeExtensions.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Reflection.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Reader.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.ResourceManager.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Resources.Writer.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.Unsafe.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.CompilerServices.VisualC.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Extensions.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Handles.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.RuntimeInformation.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.InteropServices.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Intrinsics.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Loader.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Numerics.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Formatters.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Json.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Primitives.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.Xml.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.Serialization.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Runtime.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.AccessControl.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Claims.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Algorithms.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Cng.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Csp.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Encoding.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.OpenSsl.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Primitives.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.X509Certificates.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.Windows.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Principal.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.SecureString.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceModel.Web.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ServiceProcess.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.CodePages.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.Extensions.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encoding.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Encodings.Web.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.Json.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Text.RegularExpressions.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Channels.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Overlapped.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Dataflow.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Extensions.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.Parallel.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Tasks.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Thread.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.ThreadPool.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.Timer.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Threading.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.Local.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Transactions.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.ValueTuple.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Web.HttpUtility.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Web.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Windows.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Linq.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.ReaderWriter.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.Serialization.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XDocument.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.XDocument.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XPath.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlDocument.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.XmlSerializer.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Xml.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/WindowsBase.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clrcompression.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clretwrc.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/clrjit.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/coreclr.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/createdump.exe +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/dbgshim.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/hostfxr.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/hostpolicy.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore_amd64_amd64_5.0.521.16609.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordbi.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscorlib.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscorrc.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/netstandard.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/vccorlib140.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/vcruntime140.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/vcruntime140_1.dll +0 -0
- data/bin/ruby_bin_folder/x86/Chef.PowerShell.dll +0 -0
- data/bin/ruby_bin_folder/x86/Chef.Powershell.Wrapper.dll +0 -0
- data/bin/ruby_bin_folder/x86/concrt140.dll +0 -0
- data/bin/ruby_bin_folder/x86/msvcp140.dll +0 -0
- data/bin/ruby_bin_folder/x86/msvcp140_1.dll +0 -0
- data/bin/ruby_bin_folder/x86/msvcp140_2.dll +0 -0
- data/bin/ruby_bin_folder/x86/msvcp140_atomic_wait.dll +0 -0
- data/bin/ruby_bin_folder/x86/msvcp140_codecvt_ids.dll +0 -0
- data/bin/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll +0 -0
- data/bin/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll +0 -0
- data/bin/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb +0 -0
- data/bin/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Newtonsoft.Json.dll +0 -0
- data/bin/ruby_bin_folder/x86/vccorlib140.dll +0 -0
- data/bin/ruby_bin_folder/x86/vcruntime140.dll +0 -0
- data/chef-powershell.gemspec +52 -52
- data/lib/chef-powershell/exceptions.rb +26 -26
- data/lib/chef-powershell/json_compat.rb +3 -3
- data/lib/chef-powershell/powershell.rb +41 -20
- data/lib/chef-powershell/powershell_exec.rb +10 -9
- data/lib/chef-powershell/pwsh.rb +9 -5
- data/lib/chef-powershell/version.rb +20 -20
- data/lib/chef-powershell.rb +1 -1
- data/spec/unit/powershell_exec_spec.rb +16 -11
- metadata +18 -20
- data/bin/powershell/chef/chef.psm1 +0 -459
- data/bin/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/canary.txt +0 -1
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/mscordaccore_amd64_amd64_5.0.20.51904.dll +0 -0
data/chef-powershell.gemspec
CHANGED
@@ -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{
|
15
|
-
spec.homepage = "https://github.com/chef/chef
|
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/
|
26
|
-
"documentation_uri" => "https://github.com/chef/chef/
|
27
|
-
"homepage_uri" => "https://github.com/chef/chef/tree/main/chef-powershell",
|
28
|
-
"source_code_uri" => "https://github.com/chef/chef/
|
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
|
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
|
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
|
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
|
43
|
-
#
|
44
|
-
#
|
45
|
-
|
46
|
-
|
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 [
|
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
|
-
|
70
|
-
|
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
|
-
|
73
|
-
|
74
|
-
|
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
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
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
|
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
|
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
|
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
|
-
#
|
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
|
data/lib/chef-powershell/pwsh.rb
CHANGED
@@ -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"] =
|
50
|
-
ENV["DOTNET_ROOT(x86)"] =
|
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
|
-
@
|
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.
|
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
|
data/lib/chef-powershell.rb
CHANGED
@@ -18,40 +18,45 @@
|
|
18
18
|
|
19
19
|
require "chef-powershell"
|
20
20
|
|
21
|
-
describe Chef_PowerShell::ChefPowerShell::
|
22
|
-
let(:powershell_mixin) { Class.new { include Chef_PowerShell::ChefPowerShell::
|
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
|
32
|
-
execution = object.powershell_exec("$PSVersionTable")
|
33
|
-
expect(execution.result["PSVersion"].to_s.to_i).to be <
|
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.
|
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:
|
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: '
|
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: '
|
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: '
|
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: '
|
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.
|
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
|
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/
|
677
|
-
documentation_uri: https://github.com/chef/chef/
|
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/
|
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.
|
694
|
+
rubygems_version: 3.2.22
|
697
695
|
signing_key:
|
698
696
|
specification_version: 4
|
699
|
-
summary:
|
697
|
+
summary: External Chef module for accessing and utilizing PowerShell
|
700
698
|
test_files: []
|