ArmImageBuilderModelFactory.ImageTemplatePowerShellCustomizer Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Runs the specified PowerShell on the VM (Windows). Corresponds to Packer powershell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified.
public static Azure.ResourceManager.ImageBuilder.Models.ImageTemplatePowerShellCustomizer ImageTemplatePowerShellCustomizer(string name = default, string scriptUri = default, string sha256Checksum = default, System.Collections.Generic.IEnumerable<string> inline = default, bool? isRunElevated = default, bool? isRunAsSystem = default, System.Collections.Generic.IEnumerable<int> validExitCodes = default);
static member ImageTemplatePowerShellCustomizer : string * string * string * seq<string> * Nullable<bool> * Nullable<bool> * seq<int> -> Azure.ResourceManager.ImageBuilder.Models.ImageTemplatePowerShellCustomizer
Public Shared Function ImageTemplatePowerShellCustomizer (Optional name As String = Nothing, Optional scriptUri As String = Nothing, Optional sha256Checksum As String = Nothing, Optional inline As IEnumerable(Of String) = Nothing, Optional isRunElevated As Nullable(Of Boolean) = Nothing, Optional isRunAsSystem As Nullable(Of Boolean) = Nothing, Optional validExitCodes As IEnumerable(Of Integer) = Nothing) As ImageTemplatePowerShellCustomizer
Parameters
- name
- String
Friendly Name to provide context on what this customization step does.
- scriptUri
- String
URI of the PowerShell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc.
- sha256Checksum
- String
SHA256 checksum of the power shell script provided in the scriptUri field above.
- inline
- IEnumerable<String>
Array of PowerShell commands to execute.
If specified, the PowerShell script will be run with elevated privileges.
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.
- validExitCodes
- IEnumerable<Int32>
Valid exit codes for the PowerShell script. [Default: 0].
Returns
A new ImageTemplatePowerShellCustomizer instance for mocking.