Bewerken

Delen via


New-AzDevCenterUserEnvironment

Creates or updates an environment.

Syntax

New-AzDevCenterUserEnvironment
   -Endpoint <String>
   -Name <String>
   -ProjectName <String>
   [-UserId <String>]
   -CatalogName <String>
   -EnvironmentDefinitionName <String>
   -EnvironmentType <String>
   [-Parameter <Hashtable>]
   [-ExpirationDate <DateTime>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzDevCenterUserEnvironment
   -Endpoint <String>
   -InputObject <IDevCenterdataIdentity>
   -CatalogName <String>
   -EnvironmentDefinitionName <String>
   -EnvironmentType <String>
   [-Parameter <Hashtable>]
   [-ExpirationDate <DateTime>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzDevCenterUserEnvironment
   -DevCenterName <String>
   -InputObject <IDevCenterdataIdentity>
   -CatalogName <String>
   -EnvironmentDefinitionName <String>
   -EnvironmentType <String>
   [-Parameter <Hashtable>]
   [-ExpirationDate <DateTime>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzDevCenterUserEnvironment
   -DevCenterName <String>
   -Name <String>
   -ProjectName <String>
   [-UserId <String>]
   -CatalogName <String>
   -EnvironmentDefinitionName <String>
   -EnvironmentType <String>
   [-Parameter <Hashtable>]
   [-ExpirationDate <DateTime>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Creates or updates an environment.

Examples

Example 1: Create an environment by endpoint

$functionAppParameters = @{"name" = "testfuncApp" }
$currentDate = Get-Date
$dateIn8Months = $currentDate.AddMonths(8)

New-AzDevCenterUserEnvironment -Endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" -Name "envtest" -ProjectName DevProject -CatalogName CentralCatalog -EnvironmentDefinitionName FunctionApp -EnvironmentType DevTest -Parameter $functionAppParameters -ExpirationDate $dateIn8Months

This command creates an environment named envtest" to the project "DevProject".

Example 2: Create an environment by dev center

$currentDate = Get-Date
$dateIn8Months = $currentDate.AddMonths(8)

New-AzDevCenterUserEnvironment -DevCenterName Contoso -Name "envtest" -ProjectName DevProject -CatalogName CentralCatalog -EnvironmentDefinitionName Sandbox -EnvironmentType DevTest -ExpirationDate $dateIn8Months

This command creates an environment named envtest" to the project "DevProject".

Example 3: Create an environment by endpoint and InputObject

$envInput = @{"UserId" = "me"; "ProjectName" = "DevProject"; "EnvironmentName" = "envtest" }
$currentDate = Get-Date
$dateIn8Months = $currentDate.AddMonths(8)

New-AzDevCenterUserEnvironment -Endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" -InputObject $envInput -CatalogName CentralCatalog -EnvironmentDefinitionName Sandbox -EnvironmentType DevTest -ExpirationDate $dateIn8Months

This command creates an environment named envtest" to the project "DevProject".

Example 4: Create an environment by dev center and InputObject

$functionAppParameters = @{"name" = "testfuncApp" }
$envInput = @{"UserId" = "me"; "ProjectName" = "DevProject"; "EnvironmentName" = "envtest" }
$currentDate = Get-Date
$dateIn8Months = $currentDate.AddMonths(8)

New-AzDevCenterUserEnvironment -DevCenterName Contoso -InputObject $envInput -CatalogName CentralCatalog -EnvironmentDefinitionName FunctionApp -EnvironmentType DevTest -Parameter $functionAppParameters -ExpirationDate $dateIn8Months

This command creates an environment named envtest" to the project "DevProject".

Parameters

-AsJob

Run the command as a job

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

-CatalogName

Name of the catalog.

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DevCenterName

The DevCenter upon which to execute operations.

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

-Endpoint

The DevCenter-specific URI to operate on.

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

-EnvironmentDefinitionName

Name of the environment definition.

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

-EnvironmentType

Environment type.

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

-ExpirationDate

The time the expiration date will be triggered (UTC), after which the environment and associated resources will be deleted.

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

-InputObject

Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

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

-Name

The name of the environment.

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

-NoWait

Run the command asynchronously

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

-Parameter

Parameters object for the environment.

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

-ProjectName

The DevCenter Project upon which to execute operations.

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

-UserId

The AAD object id of the user. If value is 'me', the identity is taken from the authentication context.

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

IDevCenterdataIdentity

Outputs

Boolean