次の方法で共有


Test-AzureRmDeployment

デプロイを検証します。

警告

AzureRM PowerShell モジュールは、2024 年 2 月 29 日の時点で正式に非推奨になりました。 引き続きサポートを受け、更新を受け取れるようにするために、AzureRM から Az PowerShell モジュールに移行することをお勧めします。

AzureRM モジュールは引き続き機能する可能性がありますが、メインが維持またはサポートされなくなり、ユーザーの判断とリスクで引き続き使用できます。 Az モジュールへの移行に関するガイダンスについては、移行リソースを参照してください。

構文

Test-AzureRmDeployment
    -Location <String>
    -TemplateFile <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
Test-AzureRmDeployment
    -Location <String>
    -TemplateParameterObject <Hashtable>
    -TemplateFile <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
Test-AzureRmDeployment
    -Location <String>
    -TemplateParameterObject <Hashtable>
    -TemplateUri <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
Test-AzureRmDeployment
    -Location <String>
    -TemplateParameterFile <String>
    -TemplateFile <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
Test-AzureRmDeployment
    -Location <String>
    -TemplateParameterFile <String>
    -TemplateUri <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
Test-AzureRmDeployment
    -Location <String>
    -TemplateParameterUri <String>
    -TemplateFile <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
Test-AzureRmDeployment
    -Location <String>
    -TemplateParameterUri <String>
    -TemplateUri <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
Test-AzureRmDeployment
    -Location <String>
    -TemplateUri <String>
    [-ApiVersion <String>]
    [-Pre]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

説明

Test-AzureRmDeployment コマンドレットは、デプロイ テンプレートとそのパラメーター値が有効かどうかを判断します。

例 1: カスタム テンプレートとパラメーター ファイルを使用してデプロイをテストする

PS C:\>Test-AzureRmDeployment -Location "West US" -TemplateFile "D:\Azure\Templates\EngineeringSite.json" -TemplateParameterFile "D:\Azure\Templates\EngSiteParms.json"

このコマンドは、指定されたテンプレート ファイルとパラメーター ファイルを使用して、現在のサブスクリプション スコープでのデプロイをテストします。

パラメーター

-ApiVersion

設定すると、使用するリソース プロバイダー API のバージョンを示します。 指定しない場合、API のバージョンは、使用可能な最新のバージョンとして自動的に決定されます。

型:String
配置:Named
規定値:None
必須:False
パイプライン入力を受け取る:False
ワイルドカード文字を受け取る:False

-DefaultProfile

Azure との通信のために使用される資格情報、アカウント、テナント、サブスクリプションです。

型:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
配置:Named
規定値:None
必須:False
パイプライン入力を受け取る:False
ワイルドカード文字を受け取る:False

-Location

デプロイ データを格納する場所。

型:String
配置:Named
規定値:None
必須:True
パイプライン入力を受け取る:False
ワイルドカード文字を受け取る:False

-Pre

設定すると、使用するバージョンを自動的に決定するときに、コマンドレットでプレリリース API バージョンを使用する必要があることを示します。

型:SwitchParameter
配置:Named
規定値:None
必須:False
パイプライン入力を受け取る:False
ワイルドカード文字を受け取る:False

-TemplateFile

テンプレート ファイルへのローカル パス。

型:String
配置:Named
規定値:None
必須:True
パイプライン入力を受け取る:True
ワイルドカード文字を受け取る:False

-TemplateParameterFile

テンプレート パラメーターを含むファイル。

型:String
配置:Named
規定値:None
必須:True
パイプライン入力を受け取る:True
ワイルドカード文字を受け取る:False

-TemplateParameterObject

パラメーターを表すハッシュ テーブル。

型:Hashtable
配置:Named
規定値:None
必須:True
パイプライン入力を受け取る:True
ワイルドカード文字を受け取る:False

-TemplateParameterUri

テンプレート パラメーター ファイルへの URI。

型:String
配置:Named
規定値:None
必須:True
パイプライン入力を受け取る:True
ワイルドカード文字を受け取る:False

-TemplateUri

テンプレート ファイルの URI。

型:String
配置:Named
規定値:None
必須:True
パイプライン入力を受け取る:True
ワイルドカード文字を受け取る:False

入力

String

Microsoft.Azure.Management.ResourceManager.Models.DeploymentMode System.Collections.Hashtable

出力

PSResourceManagerError