Class ImageTemplatePowerShellCustomizer


  • public final class ImageTemplatePowerShellCustomizer
    extends ImageTemplateCustomizer
    Runs the specified PowerShell on the VM (Windows). Corresponds to Packer powershell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified.
    • Constructor Detail

      • ImageTemplatePowerShellCustomizer

        public ImageTemplatePowerShellCustomizer()
    • Method Detail

      • scriptUri

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

        public ImageTemplatePowerShellCustomizer withScriptUri​(String scriptUri)
        Set the scriptUri property: URI of the PowerShell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc.
        Parameters:
        scriptUri - the scriptUri value to set.
        Returns:
        the ImageTemplatePowerShellCustomizer 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 ImageTemplatePowerShellCustomizer 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 ImageTemplatePowerShellCustomizer object itself.
      • inline

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

        public ImageTemplatePowerShellCustomizer withInline​(List<String> inline)
        Set the inline property: Array of PowerShell commands to execute.
        Parameters:
        inline - the inline value to set.
        Returns:
        the ImageTemplatePowerShellCustomizer 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 ImageTemplatePowerShellCustomizer 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 ImageTemplatePowerShellCustomizer 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 ImageTemplatePowerShellCustomizer 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 ImageTemplatePowerShellCustomizer 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 ImageTemplatePowerShellCustomizer 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 ImageTemplatePowerShellCustomizer object itself.