Get-SCSQLScriptCommand
Mendapatkan skrip SQL Server untuk penyebaran aplikasi.
Sintaks
Get-SCSQLScriptCommand
[-VMMServer <ServerConnection>]
-ApplicationDeployment <ApplicationDeployment>
[<CommonParameters>]
Deskripsi
Cmdlet Get-SCSQLScriptCommand mendapatkan skrip Microsoft SQL Server untuk penyebaran aplikasi.
Contoh
Contoh 1: Dapatkan perintah skrip SQL Server tertentu untuk penyebaran aplikasi
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"}
Perintah pertama mendapatkan objek profil aplikasi bernama SvcWebAppProfile01, lalu menyimpan objek tersebut dalam variabel $AppProfile.
Perintah kedua mendapatkan objek penyebaran aplikasi bernama SQLDataTierApp01 untuk profil aplikasi yang disimpan di $AppProfile, lalu menyimpan objek tersebut dalam variabel $AppDeployment.
Perintah terakhir mendapatkan skrip SQL Server PreInstall pertama yang terkait dengan penyebaran aplikasi yang disimpan di $AppDeployment. Cmdlet memilih objek yang benar dengan menentukan urutan penyebaran 1 dan jenis skrip PreInstall.
Parameter
-ApplicationDeployment
Menentukan objek penyebaran aplikasi.
Type: | ApplicationDeployment |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VMMServer
Menentukan objek server Virtual Machine Manager (VMM).
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Output
SQLScriptCommand
Cmdlet ini mengembalikan objek SQLScriptCommand .