New-PartnerCustomerCart

Creates a cart for a customer.

Syntax

Default (Default)

New-PartnerCustomerCart
    -CustomerId <String>
    -LineItems <PSCartLineItem[]>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Creates a cart for a customer.

Examples

Example 1

PS C:\> # Get the product information for the Azure Plan
PS C:\> $product = Get-PartnerProduct -ProductId 'DZH318Z0BPS6'
PS C:\> # Get the SKU information for the Azure Plan
PS C:\> $sku = Get-PartnerProductSku -ProductId $product.ProductId
PS C:\> # Get the availability information required for purchasing an Azure Plan
PS C:\> $availability = Get-PartnerProductAvailability -ProductId $product.ProductId -SkuId $sku.SkuId
PS C:\>
PS C:\> $lineItem = New-Object -TypeName Microsoft.Store.PartnerCenter.PowerShell.Models.Carts.PSCartLineItem
PS C:\>
PS C:\> $lineItem.BillingCycle = 'OneTime'
PS C:\> $lineItem.CatalogItemId = $availability.CatalogItemId
PS C:\> $lineItem.Quantity = 1
PS C:\>
PS C:\> New-PartnerCustomerCart -CustomerId '46a62ece-10ad-42e5-b3f1-b2ed53e6fc08' -LineItems $lineItem

Creates a cart for the specified with a line item to purchase an Azure Plan

Example 2

PS C:\> $lineItem = New-Object -TypeName Microsoft.Store.PartnerCenter.PowerShell.Models.Carts.PSCartLineItem
PS C:\>
PS C:\> $lineItem.BillingCycle = 'OneTime'
PS C:\> $lineItem.CatalogItemId = 'DG7GMGF0DWTL:0001:DG7GMGF0DSJB'
PS C:\> $lineItem.FriendlyName = 'Sample RI Purchase'
PS C:\> $lineItem.ProvisioningContext.Add('duration', '1Year')
PS C:\> $lineItem.ProvisioningContext.Add('scope', 'shared')
PS C:\> $lineItem.ProvisioningContext.Add('subscriptionId', 'aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e')
PS C:\> $lineItem.Quantity = 10
PS C:\>
PS C:\> New-PartnerCustomerCart -CustomerId '46a62ece-10ad-42e5-b3f1-b2ed53e6fc08' -LineItems $lineItem

Creates an cart for a customer.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CustomerId

The identifier for the customer.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LineItems

A list of cart line items.

Parameter properties

Type:

PSCartLineItem[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

Microsoft.Store.PartnerCenter.PowerShell.Models.Carts.PSCart