Add-SCApplicationDeployment
將應用程式新增至應用程式佈建檔。
Syntax
Add-SCApplicationDeployment
-SQLDeploymentRunAsAccount <VMMCredential>
[-TimeoutSeconds <Int32>]
[-VMMServer <ServerConnection>]
-ApplicationProfile <ApplicationProfile>
[-ApplicationPackage <ApplicationPackage>]
-Name <String>
[-SQLDac]
[-SQLInstanceName <String>]
[-DACInstanceName <String>]
[-SQLAuthenticationType <String>]
[-SkipPolicyValidation <Boolean>]
[-BlockOnChanges <Boolean>]
[-IgnoreDataLoss <Boolean>]
[-RollbackOnFailure <Boolean>]
[-UninstallMode <String>]
[-FailDeploymentIfDBExists <Boolean>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
Add-SCApplicationDeployment
[-TimeoutSeconds <Int32>]
[-RunAsAccount <VMMCredential>]
[-VMMServer <ServerConnection>]
-ApplicationProfile <ApplicationProfile>
[-ApplicationPackage <ApplicationPackage>]
-Name <String>
[-Script]
[-Executable <String>]
[-CommandParameters <String>]
[-Scriptblock <String>]
[-ScriptCommandSetting <SCScriptCommandSetting>]
[-StandardInput <String>]
[-LibraryResource <CustomResource>]
[-EnvironmentVariables <Hashtable>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
Add-SCApplicationDeployment
[-TimeoutSeconds <Int32>]
[-VMMServer <ServerConnection>]
-ApplicationProfile <ApplicationProfile>
[-ApplicationPackage <ApplicationPackage>]
-Name <String>
[-WebDeploy]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
Description
Add-SCApplicationDeployment Cmdlet 會將應用程式新增至應用程式佈建檔。
範例
範例 1:將 Web 應用程式新增至應用程式部署
PS C:\> $AppProfile = Get-SCApplicationProfile -Name "SvcWebAppProfile01"
PS C:\> $AppPackage = Get-SCApplicationPackage -Name "WebApp01.zip"
PS C:\> $AppDeployment = Add-SCApplicationDeployment -ApplicationProfile $AppProfile -WebDeploy -Name "SvcWebDeployment01" -ApplicationPackage $AppPackage
第一個命令會取得名為 SvcWebAppProfile01 的應用程式佈建檔物件,並將物件儲存在$AppProfile變數中。
第二個命令會從 VMM 程式庫取得名為 WebApp01.zip 的應用程式套件物件,並將物件儲存在$AppPackage變數中。
最後一個命令會將儲存在 $AppPackage 的應用程式套件新增至儲存在 $AppProfile 的應用程式佈建檔,並將應用程式部署命名為 SvcWebDepAD。
參數
-ApplicationPackage
指定應用程式封裝物件。
Type: | ApplicationPackage |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ApplicationProfile
指定應用程式佈建檔物件。
Type: | ApplicationProfile |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-BlockOnChanges
指出如果資料庫架構與上一個 DAC 中所定義的架構不同,是否封鎖 SQL DAC 更新。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CommandParameters
指定腳本或可執行程式的參數。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DACInstanceName
指定 DAC) 實例 (資料層應用程式的名稱。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EnvironmentVariables
指定雜湊表,其中包含應用程式的環境變數。
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Executable
指定可執行程式的名稱。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-FailDeploymentIfDBExists
指出如果已經有相同名稱的資料庫存在,是否要繼續進行部署。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IgnoreDataLoss
指出是否忽略更新SQL Server資料庫時可能發生的資料遺失。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
指定追蹤工作進度,並將工作進度存放在這個參數命名的變數中。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LibraryResource
指定儲存在 Virtual Machine Manager (VMM) 程式庫中的資源。
Type: | CustomResource |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
指定 VMM 物件的名稱。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PROTipID
指定觸發此動作 (PRO 提示) 效能和資源優化提示的識別碼。 此參數可讓您稽核 PRO 秘訣。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RollbackOnFailure
指出如果SQL Server資料庫更新失敗,是否要復原任何變更。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsAccount
指定執行身分帳戶,其中包含具有執行此動作許可權的認證。
Type: | VMMCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
表示作業會以非同步方式執行,讓控制項立即返回命令殼層。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Script
指定 VMM 指令碼物件。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Scriptblock
指定腳本區塊作為腳本應用程式的字串。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ScriptCommandSetting
指定指令碼命令設定物件。
Type: | SCScriptCommandSetting |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SkipPolicyValidation
指出是否應該針對SQL Server資料庫進行原則驗證。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SQLAuthenticationType
指定SQL Server驗證類型。 有效值為:
- SQLServerAuthentication
- WindowsAuthentication
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SQLDac
指出應用程式是SQL Server資料層應用程式 (DAC) 。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SQLDeploymentRunAsAccount
指定要用來與SQL Server部署通訊的執行身分帳戶。
Type: | VMMCredential |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SQLInstanceName
指定SQL Server實例的名稱。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-StandardInput
指定檔案的路徑,其中包含要與指令碼命令搭配使用的標準輸入資訊。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TimeoutSeconds
指定進程在逾時前等候的時間量,以秒為單位。
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UninstallMode
指定卸載模式。 有效值為:
- MakeUnmanaged
- DetachDatabase
- DropDatabase
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
指定 VMM 伺服器物件。
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WebDeploy
表示應用程式是 Web 應用程式。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
輸出
ApplicationDeployment
此 Cmdlet 會傳回 ApplicationDeployment 物件。