< Back

Add-PartnerCustomerCartLineItem

Sat Jan 18, 2020 6:26 pm

NAME Add-PartnerCustomerCartLineItem



SYNOPSIS

Adds a new line item to the specified cart.





SYNTAX

Add-PartnerCustomerCartLineItem -CartId <String> -CustomerId <String> -LineItem <PSCartLineItem> [-Confirm]

[-WhatIf] [<CommonParameters>]





DESCRIPTION

Adds a new line item to the specified cart.





PARAMETERS

-CartId <String>

The identifier for the cart.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-CustomerId <String>

The identifier for the customer.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-LineItem <PSCartLineItem>

The line item to be added.



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:\\> $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:\\> Add-PartnerCustomerCartLineItem -CartId '65faf57b-0205-47ee-92b3-08dcf233ea73' -CustomerId

'46a62ece-10ad-42e5-b3f1-b2ed53e6fc08' -LineItem $lineItem



Adds a line item to purchase a reserved instance to the specified cart.





-------------------------- 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 = 'DZH318Z0BPS6:0001:DZH318Z0BML6'

PS C:\\> $lineItem.FriendlyName = 'Microsoft Azure Plan'

PS C:\\> $lineItem.Quantity = 1

PS C:\\>

PS C:\\> Add-PartnerCustomerCartLineItem -CartId '65faf57b-0205-47ee-92b3-08dcf233ea73' -CustomerId

'46a62ece-10ad-42e5-b3f1-b2ed53e6fc08' -LineItem $lineItem



Adds a line item to purchase the Microsoft Azure Plan to the specified cart.







RELATED LINKS

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