

のバージョン 5 (V5) AWS Tools for PowerShell がリリースされました。

重要な変更とアプリケーションの移行については、[「移行トピック](https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html)」を参照してください。

 [https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html](https://docs.aws.amazon.com/powershell/v5/userguide/migrating-v5.html)

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# AWS Budgets Tools for PowerShell V5 を使用した の例
<a name="powershell_budgets_code_examples"></a>

次のコード例は、 で AWS Tools for PowerShell V5 を使用してアクションを実行し、一般的なシナリオを実装する方法を示しています AWS Budgets。

*アクション*はより大きなプログラムからのコードの抜粋であり、コンテキスト内で実行する必要があります。アクションは個々のサービス機能を呼び出す方法を示していますが、コンテキスト内のアクションは、関連するシナリオで確認できます。

各例には完全なソースコードへのリンクが含まれており、コードの設定方法と実行方法に関する手順を確認できます。

**Topics**
+ [アクション](#actions)

## アクション
<a name="actions"></a>

### `New-BGTBudget`
<a name="budgets_CreateBudget_powershell_topic"></a>

次のコード例は、`New-BGTBudget` を使用する方法を示しています。

**Tools for PowerShell V5**  
**例 1: 指定された予算と時間の制約を持つ新しい予算を作成し、E メール通知を設定します。**  

```
$notification = @{
    NotificationType = "ACTUAL"
    ComparisonOperator = "GREATER_THAN"
    Threshold = 80
}

$addressObject = @{
    Address = @("user@domain.com")
    SubscriptionType = "EMAIL"
}

$subscriber = New-Object Amazon.Budgets.Model.NotificationWithSubscribers
$subscriber.Notification = $notification
$subscriber.Subscribers.Add($addressObject)

$startDate = [datetime]::new(2017,09,25)
$endDate = [datetime]::new(2017,10,25)

New-BGTBudget -Budget_BudgetName "Tester" -Budget_BudgetType COST -CostTypes_IncludeTax $true -Budget_TimeUnit MONTHLY -BudgetLimit_Unit USD -TimePeriod_Start $startDate -TimePeriod_End $endDate -AccountId 123456789012 -BudgetLimit_Amount 200 -NotificationsWithSubscriber $subscriber
```
+  API の詳細については、*AWS Tools for PowerShell コマンドレットリファレンス (V5)* の「[CreateBudget](https://docs.aws.amazon.com/powershell/v5/reference)」を参照してください。