New-AzContainerInstanceInitDefinitionObject

Create a in-memory object for InitContainerDefinition

Syntax

New-AzContainerInstanceInitDefinitionObject
   -Name <String>
   [-Command <String[]>]
   [-EnvironmentVariable <IEnvironmentVariable[]>]
   [-Image <String>]
   [-VolumeMount <IVolumeMount[]>]
   [<CommonParameters>]

Description

Create a in-memory object for InitContainerDefinition

Examples

Example 1: Set up the init container definition

New-AzContainerInstanceInitDefinitionObject -Name "initDefinition" -Command "/bin/sh -c myscript.sh"

Name
----
initDefinition

This command sets up the init container definition with command /bin/sh -c myscript.sh

Parameters

-Command

The command to execute within the init container in exec form.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnvironmentVariable

The environment variables to set in the init container. To construct, see NOTES section for ENVIRONMENTVARIABLE properties and create a hash table.

Type:IEnvironmentVariable[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Image

The image of the init container.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

The name for the init container.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-VolumeMount

The volume mounts available to the init container. To construct, see NOTES section for VOLUMEMOUNT properties and create a hash table.

Type:IVolumeMount[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

InitContainerDefinition

Notes

ALIASES

COMPLEX PARAMETER PROPERTIES

To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.

ENVIRONMENTVARIABLE <IEnvironmentVariable[]>: The environment variables to set in the init container.

  • Name <String>: The name of the environment variable.
  • [SecureValue <String>]: The value of the secure environment variable.
  • [Value <String>]: The value of the environment variable.

VOLUMEMOUNT <IVolumeMount[]>: The volume mounts available to the init container.

  • MountPath <String>: The path within the container where the volume should be mounted. Must not contain colon (:).
  • Name <String>: The name of the volume mount.
  • [ReadOnly <Boolean?>]: The flag indicating whether the volume mount is read-only.