Class ImageTemplatePowerShellCustomizer
- java.lang.Object
-
- com.azure.resourcemanager.imagebuilder.models.ImageTemplateCustomizer
-
- com.azure.resourcemanager.imagebuilder.models.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 Summary
Constructors Constructor Description ImageTemplatePowerShellCustomizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
inline()
Get the inline property: Array of PowerShell commands to execute.Boolean
runAsSystem()
Get the runAsSystem property: If specified, the PowerShell script will be run with elevated privileges using the Local System user.Boolean
runElevated()
Get the runElevated property: If specified, the PowerShell script will be run with elevated privileges.String
scriptUri()
Get the scriptUri property: URI of the PowerShell script to be run for customizing.String
sha256Checksum()
Get the sha256Checksum property: SHA256 checksum of the power shell script provided in the scriptUri field above.void
validate()
Validates the instance.List<Integer>
validExitCodes()
Get the validExitCodes property: Valid exit codes for the PowerShell script.ImageTemplatePowerShellCustomizer
withInline(List<String> inline)
Set the inline property: Array of PowerShell commands to execute.ImageTemplatePowerShellCustomizer
withName(String name)
Set the name property: Friendly Name to provide context on what this customization step does.ImageTemplatePowerShellCustomizer
withRunAsSystem(Boolean runAsSystem)
Set the runAsSystem property: If specified, the PowerShell script will be run with elevated privileges using the Local System user.ImageTemplatePowerShellCustomizer
withRunElevated(Boolean runElevated)
Set the runElevated property: If specified, the PowerShell script will be run with elevated privileges.ImageTemplatePowerShellCustomizer
withScriptUri(String scriptUri)
Set the scriptUri property: URI of the PowerShell script to be run for customizing.ImageTemplatePowerShellCustomizer
withSha256Checksum(String sha256Checksum)
Set the sha256Checksum property: SHA256 checksum of the power shell script provided in the scriptUri field above.ImageTemplatePowerShellCustomizer
withValidExitCodes(List<Integer> validExitCodes)
Set the validExitCodes property: Valid exit codes for the PowerShell script.-
Methods inherited from class com.azure.resourcemanager.imagebuilder.models.ImageTemplateCustomizer
name
-
-
-
-
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.
-
withName
public ImageTemplatePowerShellCustomizer withName(String name)
Set the name property: Friendly Name to provide context on what this customization step does.- Overrides:
withName
in classImageTemplateCustomizer
- Parameters:
name
- the name value to set.- Returns:
- the ImageTemplateCustomizer object itself.
-
validate
public void validate()
Validates the instance.- Overrides:
validate
in classImageTemplateCustomizer
- Throws:
IllegalArgumentException
- thrown if the instance is not valid.
-
-