< Back

New-PartnerCustomerCart

Sat Jan 18, 2020 6:34 pm

NAME New-PartnerCustomerCart



SYNOPSIS

Creates a cart for a customer.





SYNTAX

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

[<CommonParameters>]





DESCRIPTION

Creates a cart for a customer.





PARAMETERS

-CustomerId <String>

The identifier for the customer.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-LineItems <PSCartLineItem[]>

A list of cart line items.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None







OUTPUTS

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







NOTES









-------------------------- 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', 'D526EF3A-35E6-477F-A64C-906F6177FBFA')

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.







RELATED LINKS

Online Version: https://docs.microsoft.com/powershell/m ... stomerCart