public sealed class OSPolicy.Types.Resource.Types.ExecResource.Types.Exec : IMessage<OSPolicy.Types.Resource.Types.ExecResource.Types.Exec>, IEquatable<OSPolicy.Types.Resource.Types.ExecResource.Types.Exec>, IDeepCloneable<OSPolicy.Types.Resource.Types.ExecResource.Types.Exec>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud OS Config v1alpha API class OSPolicy.Types.Resource.Types.ExecResource.Types.Exec.
Only recorded for enforce Exec.
Path to an output file (that is created by this Exec) whose
content will be recorded in OSPolicyResourceCompliance after a
successful run. Absence or failure to read this file will result in
this ExecResource being non-compliant. Output file size is limited to
100K bytes.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis document provides reference information for the \u003ccode\u003eOSPolicy.Types.Resource.Types.ExecResource.Types.Exec\u003c/code\u003e class within the Google Cloud OS Config v1alpha API.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eExec\u003c/code\u003e class represents a file or script that can be executed, which is part of the Google Cloud OS Config API and is available in versions 2.0.0-alpha06, 2.0.0-alpha05, and 1.0.0-alpha04.\u003c/p\u003e\n"],["\u003cp\u003eKey features of the \u003ccode\u003eExec\u003c/code\u003e class include the ability to define a script interpreter, specify arguments for the script, and set an output file path for compliance recording.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eExec\u003c/code\u003e class supports both inline scripts and the use of external files, and it implements multiple interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe available constructors for this class are \u003ccode\u003eExec()\u003c/code\u003e and \u003ccode\u003eExec(OSPolicy.Types.Resource.Types.ExecResource.Types.Exec other)\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Google Cloud OS Config v1alpha API - Class OSPolicy.Types.Resource.Types.ExecResource.Types.Exec (2.0.0-alpha06)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.0-alpha06 (latest)](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.ExecResource.Types.Exec)\n- [2.0.0-alpha05](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/2.0.0-alpha05/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.ExecResource.Types.Exec)\n- [1.0.0-alpha04](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/1.0.0-alpha04/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.ExecResource.Types.Exec) \n\n public sealed class OSPolicy.Types.Resource.Types.ExecResource.Types.Exec : IMessage\u003cOSPolicy.Types.Resource.Types.ExecResource.Types.Exec\u003e, IEquatable\u003cOSPolicy.Types.Resource.Types.ExecResource.Types.Exec\u003e, IDeepCloneable\u003cOSPolicy.Types.Resource.Types.ExecResource.Types.Exec\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud OS Config v1alpha API class OSPolicy.Types.Resource.Types.ExecResource.Types.Exec.\n\nA file or script to execute. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e OSPolicy.Types.Resource.Types.ExecResource.Types.Exec \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[OSPolicy](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy)[Types](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types)[Resource](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource)[Types](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types)[ExecResource](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.ExecResource)[Types](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.ExecResource.Types)[Exec](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.ExecResource.Types.Exec), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[OSPolicy](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy)[Types](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types)[Resource](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource)[Types](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types)[ExecResource](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.ExecResource)[Types](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.ExecResource.Types)[Exec](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.ExecResource.Types.Exec), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[OSPolicy](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy)[Types](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types)[Resource](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource)[Types](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types)[ExecResource](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.ExecResource)[Types](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.ExecResource.Types)[Exec](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha.OSPolicy.Types.Resource.Types.ExecResource.Types.Exec), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.OsConfig.V1Alpha](/dotnet/docs/reference/Google.Cloud.OsConfig.V1Alpha/latest/Google.Cloud.OsConfig.V1Alpha)\n\nAssembly\n--------\n\nGoogle.Cloud.OsConfig.V1Alpha.dll\n\nConstructors\n------------\n\n### Exec()\n\n public Exec()\n\n### Exec(Exec)\n\n public Exec(OSPolicy.Types.Resource.Types.ExecResource.Types.Exec other)\n\nProperties\n----------\n\n### Args\n\n public RepeatedField\u003cstring\u003e Args { get; }\n\nOptional arguments to pass to the source during execution.\n\n### File\n\n public OSPolicy.Types.Resource.Types.File File { get; set; }\n\nA remote or local file.\n\n### HasScript\n\n public bool HasScript { get; }\n\nGets whether the \"script\" field is set\n\n### Interpreter\n\n public OSPolicy.Types.Resource.Types.ExecResource.Types.Exec.Types.Interpreter Interpreter { get; set; }\n\nRequired. The script interpreter to use.\n\n### OutputFilePath\n\n public string OutputFilePath { get; set; }\n\nOnly recorded for enforce Exec.\nPath to an output file (that is created by this Exec) whose\ncontent will be recorded in OSPolicyResourceCompliance after a\nsuccessful run. Absence or failure to read this file will result in\nthis ExecResource being non-compliant. Output file size is limited to\n100K bytes.\n\n### Script\n\n public string Script { get; set; }\n\nAn inline script.\nThe size of the script is limited to 1024 characters.\n\n### SourceCase\n\n public OSPolicy.Types.Resource.Types.ExecResource.Types.Exec.SourceOneofCase SourceCase { get; }"]]