ArmImageBuilderModelFactory.ImageTemplatePowerShellValidator 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 script during the validation phase (Windows). Corresponds to Packer powershell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified.
public static Azure.ResourceManager.ImageBuilder.Models.ImageTemplatePowerShellValidator ImageTemplatePowerShellValidator(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 ImageTemplatePowerShellValidator : string * string * string * seq<string> * Nullable<bool> * Nullable<bool> * seq<int> -> Azure.ResourceManager.ImageBuilder.Models.ImageTemplatePowerShellValidator
Public Shared Function ImageTemplatePowerShellValidator (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 ImageTemplatePowerShellValidator
Parameters
- name
- String
Friendly Name to provide context on what this validation step does.
- scriptUri
- String
URI of the PowerShell script to be run for validation. It can be a github link, Azure Storage URI, 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 ImageTemplatePowerShellValidator instance for mocking.