Class ImageTemplatePowerShellValidator


  • public final class ImageTemplatePowerShellValidator
    extends ImageTemplateInVMValidator
    Runs the specified PowerShell script during the validation phase (Windows). Corresponds to Packer powershell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified.
    • Constructor Detail

      • ImageTemplatePowerShellValidator

        public ImageTemplatePowerShellValidator()
    • Method Detail

      • scriptUri

        public String scriptUri()
        Get the scriptUri property: URI of the PowerShell script to be run for validation. It can be a github link, Azure Storage URI, etc.
        Returns:
        the scriptUri value.
      • withScriptUri

        public ImageTemplatePowerShellValidator withScriptUri​(String scriptUri)
        Set the scriptUri property: URI of the PowerShell script to be run for validation. It can be a github link, Azure Storage URI, etc.
        Parameters:
        scriptUri - the scriptUri value to set.
        Returns:
        the ImageTemplatePowerShellValidator object itself.
      • sha256Checksum

        public String sha256Checksum()
        Get the sha256Checksum property: SHA256 checksum of the power shell script provided in the scriptUri field above.
        Returns:
        the sha256Checksum value.
      • withSha256Checksum

        public ImageTemplatePowerShellValidator withSha256Checksum​(String sha256Checksum)
        Set the sha256Checksum property: SHA256 checksum of the power shell script provided in the scriptUri field above.
        Parameters:
        sha256Checksum - the sha256Checksum value to set.
        Returns:
        the ImageTemplatePowerShellValidator object itself.
      • inline

        public List<String> inline()
        Get the inline property: Array of PowerShell commands to execute.
        Returns:
        the inline value.
      • withInline

        public ImageTemplatePowerShellValidator withInline​(List<String> inline)
        Set the inline property: Array of PowerShell commands to execute.
        Parameters:
        inline - the inline value to set.
        Returns:
        the ImageTemplatePowerShellValidator object itself.
      • runElevated

        public Boolean runElevated()
        Get the runElevated property: If specified, the PowerShell script will be run with elevated privileges.
        Returns:
        the runElevated value.
      • withRunElevated

        public ImageTemplatePowerShellValidator withRunElevated​(Boolean runElevated)
        Set the runElevated property: If specified, the PowerShell script will be run with elevated privileges.
        Parameters:
        runElevated - the runElevated value to set.
        Returns:
        the ImageTemplatePowerShellValidator object itself.
      • runAsSystem

        public Boolean runAsSystem()
        Get the runAsSystem property: 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.
        Returns:
        the runAsSystem value.
      • withRunAsSystem

        public ImageTemplatePowerShellValidator withRunAsSystem​(Boolean runAsSystem)
        Set the runAsSystem property: 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.
        Parameters:
        runAsSystem - the runAsSystem value to set.
        Returns:
        the ImageTemplatePowerShellValidator object itself.
      • validExitCodes

        public List<Integer> validExitCodes()
        Get the validExitCodes property: Valid exit codes for the PowerShell script. [Default: 0].
        Returns:
        the validExitCodes value.
      • withValidExitCodes

        public ImageTemplatePowerShellValidator withValidExitCodes​(List<Integer> validExitCodes)
        Set the validExitCodes property: Valid exit codes for the PowerShell script. [Default: 0].
        Parameters:
        validExitCodes - the validExitCodes value to set.
        Returns:
        the ImageTemplatePowerShellValidator object itself.