Get-SCSQLScriptCommand
Gets a SQL Server script for an application deployment.
Syntax
Default (Default)
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.
Parameter properties
Type: | ApplicationDeployment |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-VMMServer
Specifies a Virtual Machine Manager (VMM) server object.
Parameter properties
Type: | ServerConnection |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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.
Outputs
SQLScriptCommand
This cmdlet returns a SQLScriptCommand object.