Add-SCApplicationDeployment
将应用程序添加到应用程序配置文件。
语法
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>]
说明
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 提示) 的性能和资源优化提示的 ID。 此参数允许审核 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
指示作业异步运行,以便控件立即返回到命令 shell。
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 对象。