次の方法で共有


New-PartnerCustomerCart

Creates a cart for a customer.

構文

Default (既定)

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

説明

Creates a cart for a customer.

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.

パラメーター

-Confirm

Prompts you for confirmation before running the cmdlet.

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:cf

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-CustomerId

The identifier for the customer.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-LineItems

A list of cart line items.

パラメーターのプロパティ

型:

PSCartLineItem[]

規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-WhatIf

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

パラメーターのプロパティ

型:SwitchParameter
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:wi

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値: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.

入力

None

出力

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