次の方法で共有


Get-SCSQLScriptCommand

Gets a SQL Server script for an application deployment.

Syntax

Get-SCSQLScriptCommand
   [-VMMServer <ServerConnection>]
   -ApplicationDeployment <ApplicationDeployment>
   [<CommonParameters>]

Description

The Get-SCSQLScriptCommand cmdlet gets a Microsoft SQL Server script for an application deployment.

Examples

Example 1: Get a specified SQL Server script command for an application deployments

PS C:\> $AppProfile = Get-SCApplicationProfile -Name "SvcWebAppProfile01"
PS C:\> $AppDeployment = Get-SCApplicationDeployment -ApplicationProfile $AppProfile -Name "SQLDataTierApp01"
PS C:\> Get-SCSQLScriptCommand -ApplicationDeployment $AppDeployment | where {$_.DeploymentOrder -eq "1" -and $_.SQLScriptType -eq "PreInstall"}

The first command gets the application profile object named SvcWebAppProfile01, and then stores that object in the $AppProfile variable.

The second command gets the application deployment object named SQLDataTierApp01 for the application profile stored in $AppProfile, and then stores that object in the $AppDeployment variable.

The last command gets the first PreInstall SQL Server script associated with the application deployment stored in $AppDeployment. The cmdlet selects the correct object by specifying a deployment order of 1 and a script type of PreInstall.

Parameters

-ApplicationDeployment

Specifies an application deployment object.

Type:ApplicationDeployment
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VMMServer

Specifies a Virtual Machine Manager (VMM) server object.

Type:ServerConnection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Outputs

SQLScriptCommand

This cmdlet returns a SQLScriptCommand object.