Condividi tramite


ImageTemplatePowerShellValidator Class

Definition

Runs the specified PowerShell script during the validation phase (Windows). Corresponds to Packer powershell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified.

[System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImageBuilder.Models.ImageTemplatePowerShellValidatorTypeConverter))]
public class ImageTemplatePowerShellValidator : Microsoft.Azure.PowerShell.Cmdlets.ImageBuilder.Models.IImageTemplatePowerShellValidator, Microsoft.Azure.PowerShell.Cmdlets.ImageBuilder.Runtime.IValidates
[<System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImageBuilder.Models.ImageTemplatePowerShellValidatorTypeConverter))>]
type ImageTemplatePowerShellValidator = class
    interface IImageTemplatePowerShellValidator
    interface IJsonSerializable
    interface IImageTemplateInVMValidator
    interface IValidates
Public Class ImageTemplatePowerShellValidator
Implements IImageTemplatePowerShellValidator, IValidates
Inheritance
ImageTemplatePowerShellValidator
Attributes
Implements

Constructors

Name Description
ImageTemplatePowerShellValidator()

Creates an new ImageTemplatePowerShellValidator instance.

Properties

Name Description
Inline

Array of PowerShell commands to execute

Name

Friendly Name to provide context on what this validation step does

RunAsSystem

If specified, the PowerShell script will be run with elevated privileges using the Local System user. Can only be true when the runElevated field above is set to true.

RunElevated

If specified, the PowerShell script will be run with elevated privileges

ScriptUri

URI of the PowerShell script to be run for validation. It can be a github link, Azure Storage URI, etc

Sha256Checksum

SHA256 checksum of the power shell script provided in the scriptUri field above

Type

The type of validation you want to use on the Image. For example, "Shell" can be shell validation

ValidExitCode

Valid exit codes for the PowerShell script. [Default: 0]

Methods

Name Description
DeserializeFromDictionary(IDictionary)

Deserializes a IDictionary into an instance of ImageTemplatePowerShellValidator.

DeserializeFromPSObject(PSObject)

Deserializes a PSObject into an instance of ImageTemplatePowerShellValidator.

FromJson(JsonNode)

Deserializes a JsonNode into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImageBuilder.Models.IImageTemplatePowerShellValidator.

FromJsonString(String)

Creates a new instance of ImageTemplatePowerShellValidator, deserializing the content from a json string.

ToJson(JsonObject, SerializationMode)

Serializes this instance of ImageTemplatePowerShellValidator into a JsonNode.

ToJsonString()

Serializes this instance to a json string.

ToString()
Validate(IEventListener)

Validates that this object meets the validation criteria.

Applies to