Set-CMScriptDeploymentType

設定文稿安裝程式部署類型。

語法

Set-CMScriptDeploymentType
   [-ContentLocation <String>]
   [-AddDetectionClause <DetectionClause[]>]
   [-CacheContent <Boolean>]
   [-ContentFallback <Boolean>]
   [-DetectionClauseConnector <Hashtable[]>]
   [-EnableBranchCache <Boolean>]
   [-EstimatedRuntimeMins <Int32>]
   [-Force32Bit <Boolean>]
   [-ForceScriptDetection32Bit <Boolean>]
   [-GroupDetectionClauses <String[]>]
   [-InstallationBehaviorType <InstallationBehaviorType>]
   [-InstallCommand <String>]
   [-InstallWorkingDirectory <String>]
   [-LogonRequirementType <LogonRequirementType>]
   [-MaximumRuntimeMins <Int32>]
   [-ProductCode <String>]
   [-RebootBehavior <PostExecutionBehavior>]
   [-RemoveDetectionClause <String[]>]
   [-RepairCommand <String>]
   [-RepairWorkingDirectory <String>]
   [-RequireUserInteraction <Boolean>]
   [-ScriptFile <String>]
   [-ScriptLanguage <ScriptLanguage>]
   [-ScriptText <String>]
   [-SlowNetworkDeploymentMode <ContentHandlingMode>]
   [-SourceUpdateProductCode <String>]
   [-UninstallCommand <String>]
   [-UninstallContentLocation <String>]
   [-UninstallOption <UninstallContentSetting>]
   [-UninstallWorkingDirectory <String>]
   [-UserInteractionMode <UserInteractionMode>]
   [-AddRequirement <Rule[]>]
   -ApplicationName <String>
   -DeploymentTypeName <String>
   [-NewName <String>]
   [-PassThru]
   [-RemoveLanguage <String[]>]
   [-RemoveRequirement <Rule[]>]
   [-AddLanguage <String[]>]
   [-Comment <String>]
   [-Force]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMScriptDeploymentType
   [-ContentLocation <String>]
   [-AddDetectionClause <DetectionClause[]>]
   [-CacheContent <Boolean>]
   [-ContentFallback <Boolean>]
   [-DetectionClauseConnector <Hashtable[]>]
   [-EnableBranchCache <Boolean>]
   [-EstimatedRuntimeMins <Int32>]
   [-Force32Bit <Boolean>]
   [-ForceScriptDetection32Bit <Boolean>]
   [-GroupDetectionClauses <String[]>]
   [-InstallationBehaviorType <InstallationBehaviorType>]
   [-InstallCommand <String>]
   [-InstallWorkingDirectory <String>]
   [-LogonRequirementType <LogonRequirementType>]
   [-MaximumRuntimeMins <Int32>]
   [-ProductCode <String>]
   [-RebootBehavior <PostExecutionBehavior>]
   [-RemoveDetectionClause <String[]>]
   [-RepairCommand <String>]
   [-RepairWorkingDirectory <String>]
   [-RequireUserInteraction <Boolean>]
   [-ScriptFile <String>]
   [-ScriptLanguage <ScriptLanguage>]
   [-ScriptText <String>]
   [-SlowNetworkDeploymentMode <ContentHandlingMode>]
   [-SourceUpdateProductCode <String>]
   [-UninstallCommand <String>]
   [-UninstallContentLocation <String>]
   [-UninstallOption <UninstallContentSetting>]
   [-UninstallWorkingDirectory <String>]
   [-UserInteractionMode <UserInteractionMode>]
   [-AddRequirement <Rule[]>]
   -Application <IResultObject>
   -DeploymentTypeName <String>
   [-NewName <String>]
   [-PassThru]
   [-RemoveLanguage <String[]>]
   [-RemoveRequirement <Rule[]>]
   [-AddLanguage <String[]>]
   [-Comment <String>]
   [-Force]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMScriptDeploymentType
   [-ContentLocation <String>]
   [-AddDetectionClause <DetectionClause[]>]
   [-CacheContent <Boolean>]
   [-ContentFallback <Boolean>]
   [-DetectionClauseConnector <Hashtable[]>]
   [-EnableBranchCache <Boolean>]
   [-EstimatedRuntimeMins <Int32>]
   [-Force32Bit <Boolean>]
   [-ForceScriptDetection32Bit <Boolean>]
   [-GroupDetectionClauses <String[]>]
   [-InstallationBehaviorType <InstallationBehaviorType>]
   [-InstallCommand <String>]
   [-InstallWorkingDirectory <String>]
   [-LogonRequirementType <LogonRequirementType>]
   [-MaximumRuntimeMins <Int32>]
   [-ProductCode <String>]
   [-RebootBehavior <PostExecutionBehavior>]
   [-RemoveDetectionClause <String[]>]
   [-RepairCommand <String>]
   [-RepairWorkingDirectory <String>]
   [-RequireUserInteraction <Boolean>]
   [-ScriptFile <String>]
   [-ScriptLanguage <ScriptLanguage>]
   [-ScriptText <String>]
   [-SlowNetworkDeploymentMode <ContentHandlingMode>]
   [-SourceUpdateProductCode <String>]
   [-UninstallCommand <String>]
   [-UninstallContentLocation <String>]
   [-UninstallOption <UninstallContentSetting>]
   [-UninstallWorkingDirectory <String>]
   [-UserInteractionMode <UserInteractionMode>]
   [-AddRequirement <Rule[]>]
   -ApplicationId <Int32>
   -DeploymentTypeName <String>
   [-NewName <String>]
   [-PassThru]
   [-RemoveLanguage <String[]>]
   [-RemoveRequirement <Rule[]>]
   [-AddLanguage <String[]>]
   [-Comment <String>]
   [-Force]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMScriptDeploymentType
   [-ContentLocation <String>]
   [-AddDetectionClause <DetectionClause[]>]
   [-CacheContent <Boolean>]
   [-ContentFallback <Boolean>]
   [-DetectionClauseConnector <Hashtable[]>]
   [-EnableBranchCache <Boolean>]
   [-EstimatedRuntimeMins <Int32>]
   [-Force32Bit <Boolean>]
   [-ForceScriptDetection32Bit <Boolean>]
   [-GroupDetectionClauses <String[]>]
   [-InstallationBehaviorType <InstallationBehaviorType>]
   [-InstallCommand <String>]
   [-InstallWorkingDirectory <String>]
   [-LogonRequirementType <LogonRequirementType>]
   [-MaximumRuntimeMins <Int32>]
   [-ProductCode <String>]
   [-RebootBehavior <PostExecutionBehavior>]
   [-RemoveDetectionClause <String[]>]
   [-RepairCommand <String>]
   [-RepairWorkingDirectory <String>]
   [-RequireUserInteraction <Boolean>]
   [-ScriptFile <String>]
   [-ScriptLanguage <ScriptLanguage>]
   [-ScriptText <String>]
   [-SlowNetworkDeploymentMode <ContentHandlingMode>]
   [-SourceUpdateProductCode <String>]
   [-UninstallCommand <String>]
   [-UninstallContentLocation <String>]
   [-UninstallOption <UninstallContentSetting>]
   [-UninstallWorkingDirectory <String>]
   [-UserInteractionMode <UserInteractionMode>]
   [-AddRequirement <Rule[]>]
   -InputObject <IResultObject>
   [-NewName <String>]
   [-PassThru]
   [-RemoveLanguage <String[]>]
   [-RemoveRequirement <Rule[]>]
   [-AddLanguage <String[]>]
   [-Comment <String>]
   [-Force]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

使用此 Cmdlet 來設定 Configuration Manager 應用程式 之腳本安裝程式 部署類型的設定。 此部署類型可以是文稿或安裝內容或執行動作的程式。 您可以將此部署類型用於 setup.exe 安裝程式或腳本包裝函式。

注意事項

從 Configuration Manager 月臺磁碟驅動器執行 Configuration Manager Cmdlet,例如 PS XYZ:\>。 如需詳細資訊,請 參閱開始使用

範例

範例 1:修改文稿安裝程式部署類型

此命令會針對名為Application01的應用程式,將卸載命令新增至名為 ScriptDT01 的部署類型。

Set-CMScriptDeploymentType -ApplicationName "Application01" -DeploymentTypeName "ScriptDT01" -Comment "Script updated to uninstall" -UninstallCommand 'msiexec /x ""\\Machine01\Resources\Applications\MSI\AdvertMSI\AdvertMSI.msi" /q'

範例 2:新增偵測方法

此範例會先使用 New-CMDetectionClauseFile Cmdlet,為大小為 1 KB、2 KB 和 4 KB 的 c:\abc\abc 檔案建立三個檔案型偵測子句。

然後,它會設定部署類型,將這些子句新增為偵測方法。 它也會將第二個和第三個子句與 OR 連接器分組。

$clauseFile1 = New-CMDetectionClauseFile -FileName "abc" -Path "c:\abc" -PropertyType Size -ExpectedValue 1024 -ExpressionOperator IsEquals -Value
$clauseFile2 = New-CMDetectionClauseFile -FileName "abc" -Path "c:\abc" -PropertyType Size -ExpectedValue 2048 -ExpressionOperator IsEquals -Value
$clauseFile3 = New-CMDetectionClauseFile -FileName "abc" -Path "c:\abc" -PropertyType Size -ExpectedValue 4096 -ExpressionOperator IsEquals -Value

Set-CMScriptDeploymentType -ApplicationName "testApp1" -DeploymentTypeName "abc" -AddDetectionClause $clauseFile1,$clauseFile2,$clauseFile3 -DetectionClauseConnector @{"LogicalName"=$clauseFile3.Setting.LogicalName;"Connector"="OR"} -GroupDetectionClauses $clauseFile2.Setting.LogicalName, $clauseFile3.Setting.LogicalName

範例 3:新增語言需求規則

此範例會使用OS Languge的需求規則來設定應用程式。

$myGC = Get-CMGlobalCondition -Name "Operating System Language" | Where-Object PlatformType -eq 1
$cultureA = [System.Globalization.CultureInfo]::GetCultures([System.Globalization.CultureTypes]::AllCultures) | Where-Object Name -eq "zh"
$cultureB = [System.Globalization.CultureInfo]::GetCultures([System.Globalization.CultureTypes]::AllCultures) | Where-Object Name -eq "zh-CN"
$myRule = $myGC | New-CMRequirementRuleOperatingSystemLanguageValue -RuleOperator NoneOf -Culture $cultureA,$cultureB -IsMobile $False

Set-CMScriptDeploymentType -ApplicationName "myApp" -DeploymentTypeName "myDT" -AddRequirement $myRule

範例 4:新增需求規則

此範例會使用物理記憶體大於 2 GB 的需求規則來設定應用程式。

$rule1 = Get-CMGlobalCondition -Name "Total physical memory" | New-CMRequirementRuleCommonValue -Value1 2048 -RuleOperator GreaterEquals
$myRuleExpression = New-CMRequirementRuleExpression -AddRequirementRule $rule1
$myGC = New-CMGlobalConditionExpression -Name "GCExp" -DeviceType Windows -RootExpression $myRuleExpression

Set-CMScriptDeploymentType -ApplicationName "myApp" -DeploymentTypeName "myDT" -AddRequirement $myGC

參數

-AddDetectionClause

為此部署類型指定偵測方法子句的陣列。 若要建立偵測子句,請使用下列其中一個 Cmdlet:

將這些 Cmdlet 的輸出儲存到變數中。 然後將這些變數指定為此參數的陣列。 例如,-AddDetectionClause $clauseFile1,$clauseFile2,$clauseFile3

您也可以使用 Get-CMDeploymentTypeDetectionClause 從另一個應用程式取得現有的偵測子句。

類型:DetectionClause[]
別名:AddDetectionClauses
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-AddLanguage

指定部署類型支援的語言標記陣列。 例如,若要新增 俄 (俄羅斯) ,請指定 標籤 ru-RU

如需詳細資訊和語言標記清單,請參閱 Windows 語言代碼識別子 (LCID) 參考。

類型:String[]
別名:AddLanguages, Languages, Language
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-AddRequirement

-Application

指定此部署類型的應用程式物件。 若要取得此物件,請使用 Get-CMApplication Cmdlet。

類型:IResultObject
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-ApplicationId

指定此部署類型的應用程式識別碼。

類型:Int32
別名:CI_ID, CIId
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-ApplicationName

指定此部署類型的應用程式名稱。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-CacheContent

將此參數設定為 , $true 以無限期地將內容儲存在用戶端快取中。

類型:Boolean
別名:PersistContentInClientCache
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Comment

指定部署類型的選擇性描述。

類型:String
別名:AdministratorComment
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Confirm

執行 Cmdlet 之前提示您確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:False
必要:False
接受管線輸入:False
接受萬用字元:False

-ContentFallback

如果您將此參數設定為 $true,當用戶端目前或鄰近界限群組中的任何發佈點上無法使用內容時,用戶端可以使用月臺預設界限群組中的發佈點。

類型:Boolean
別名:EnableContentLocationFallback, AllowClientsToUseFallbackSourceLocationForContent
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ContentLocation

指定內容的網路來源路徑。 月台系統伺服器需要讀取內容檔案的許可權。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DeploymentTypeName

指定要設定的部署類型名稱。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-DetectionClauseConnector

當您使用 GroupDetectionClauses 參數將偵測子句分組時,請使用此參數來指定連接器。

下列範例會定義 OR 連接器: @{"LogicalName"=$clauseFile3.Setting.LogicalName;"Connector"="OR"}

類型:Hashtable[]
別名:DetectionClauseConnectors
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DisableWildcardHandling

此參數會將通配符視為常值字元值。 您無法將其與 ForceWildcardHandling 結合。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-EnableBranchCache

此參數已被取代。 BranchCache 一律會在用戶端上啟用,如果發佈點支援,則會使用它。

類型:Boolean
別名:AllowClientsToShareContentOnSameSubnet
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-EstimatedRuntimeMins

為應用程式指定此部署類型的預估安裝時間,以分鐘為單位。 軟體中心會在應用程式安裝之前,向用戶顯示此估計值。

類型:Int32
別名:EstimatedInstallationTimeMinutes, EstimatedInstallationTimeMins, EstimatedRunTimeMinutes
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Force

強制命令在不要求使用者確認的情況下執行。

類型:SwitchParameter
別名:ForceForUnknownPublisher
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Force32Bit

將此參數設定為 , $true 以在64位用戶端上以32位進程的方式執行安裝和卸載程式。

類型:Boolean
別名:Force32BitInstaller
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ForceScriptDetection32Bit

如果您使用自定義腳本來偵測此部署類型是否存在,請將此參數 $true 設定為 ,以在64位用戶端上以32位進程執行腳本。

類型:Boolean
別名:Force32BitDetectionScript
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ForceWildcardHandling

此參數會處理通配符,並可能導致非預期的行為 (不建議) 。 您無法將其與 DisableWildcardHandling 結合。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-GroupDetectionClauses

當您設定規則來偵測此部署類型是否存在時,請使用此參數來群組子句。 若要建立偵測子句,請使用下列其中一個 Cmdlet:

將這些 Cmdlet 的輸出儲存到變數中。 然後使用下列格式來分組子句: $clause2.Setting.LogicalName, $clause3.Setting.LogicalName

提示

在 Configuration Manager 控制台中,當您選取 [群組 ] 動作時,子句會在群組子句前後顯示括弧。

類型:String[]
別名:GroupDetectionClausesByLogicalName
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-InputObject

指定要設定的部署類型物件。 若要取得這個物件,請使用 Get-CMDeploymentType Cmdlet。

類型:IResultObject
別名:DeploymentType
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-InstallationBehaviorType

指定此部署類型的安裝行為:

  • InstallForUser:用戶端只會為您部署應用程式的使用者安裝應用程式。
  • InstallForSystem:用戶端只會安裝應用程式一次。 它可供所有使用者使用。
  • InstallForSystemIfResourceIsDeviceOtherwiseInstallForUser:如果您將應用程式部署到裝置,用戶端會為所有使用者安裝它。 如果您將應用程式部署至使用者,用戶端只會為該使用者安裝它。
類型:InstallationBehaviorType
接受的值:InstallForUser, InstallForSystem, InstallForSystemIfResourceIsDeviceOtherwiseInstallForUser
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-InstallCommand

指定安裝程式命令列以安裝此應用程式。

類型:String
別名:InstallationProgram
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-InstallWorkingDirectory

指定客戶端執行 InstallCommand 時要作為工作目錄的路徑。

類型:String
別名:InstallationStartIn, InstallFolder
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-LogonRequirementType

指定已登入使用者的需求:

  • OnlyWhenNoUserLoggedOn:只有當沒有任何使用者登入 Windows 時。

  • OnlyWhenUserLoggedOn:只有當使用者登入時。 此選項為預設值。

  • WhetherOrNotUserLoggedOn:使用者是否已登入。

    注意事項

    WhereOrNotUserLoggedOn 已被取代。 它會由 WhetherOrNotUserLoggedOn取代。

如果您將 InstallationBehaviorType 設定為 InstallForUser,則無法設定此參數。

類型:LogonRequirementType
接受的值:OnlyWhenUserLoggedOn, WhereOrNotUserLoggedOn, WhetherOrNotUserLoggedOn, OnlyWhenNoUserLoggedOn
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-MaximumRuntimeMins

指定此應用程式部署程式允許的運行時間上限。 以分鐘為單位設定整數值。

類型:Int32
別名:MaximumAllowedRunTimeMinutes, MaximumAllowedRunTimeMins, MaximumRunTimeMinutes
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-NewName

指定要重新命名此部署類型的新名稱。

類型:String
別名:NewDeploymentTypeName
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-PassThru

新增此參數以傳回 物件,代表您正在使用的專案。 根據預設,此 Cmdlet 可能不會產生任何輸出。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ProductCode

如果應用程式使用 Windows Installer 技術,請指定要設定為偵測方法的 MSI 產品代碼。 當您使用此參數時,它會覆寫任何現有的偵測方法。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-RebootBehavior

指定安裝後行為:

  • BasedOnExitCode:根據傳回碼判斷行為。

  • NoAction:沒有特定動作。

  • ProgramReboot:軟體安裝程式可能會強制裝置重新啟動。

  • ForceReboot:Configuration Manager 用戶端會強制裝置重新啟動。

如需這些行為的詳細資訊,請參閱 在 Configuration Manager 中建立應用程式

類型:PostExecutionBehavior
接受的值:BasedOnExitCode, NoAction, ForceReboot, ProgramReboot
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-RemoveDetectionClause

指定要移除的偵測方法子句數位。

類型:String[]
別名:RemoveDetectionClauses
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-RemoveLanguage

指定要從此部署類型移除的支持語言陣列。

類型:String[]
別名:RemoveLanguages
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-RemoveRequirement

指定要從此部署類型移除的需求規則陣列。

類型:Rule[]
別名:RemoveRequirements
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-RepairCommand

使用此參數來設定修復命令。 同時設定 RepairWorkingDirectory 參數。

從 2006 版開始,您可以指定空字串。

類型:String
別名:RepairProgram
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-RepairWorkingDirectory

使用此參數來設定修復命令的工作目錄。 也請設定 RepairCommand 參數。

類型:String
別名:RepairStartIn, RepairFolder
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-RequireUserInteraction

將此參數設定為 $true ,可讓用戶檢視部署類型安裝並與其互動。

類型:Boolean
別名:RequiresUserInteraction
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ScriptFile

指定要用來偵測此部署類型的腳本檔案。 也請使用 ScriptLanguage 參數。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ScriptLanguage

如果您使用 ScriptFileScriptText 參數,請使用此參數來指定腳本語言。

類型:ScriptLanguage
別名:ScriptType
接受的值:PowerShell, VBScript, JavaScript
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ScriptText

指定要偵測此部署類型的腳本文字。 也請使用 ScriptLanguage 參數。

如需詳細資訊,請 參閱關於自定義腳本偵測方法

類型:String
別名:ScriptContent, Script
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-SlowNetworkDeploymentMode

當用戶端使用鄰近界限群組或預設月臺界限群組中的發佈點時,請指定部署選項:

  • DoNothing:不要下載內容
  • Download:從發佈點下載內容並在本機執行
類型:ContentHandlingMode
接受的值:DoNothing, Download
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-SourceUpdateProductCode

如果應用程式使用 Windows Installer 技術,請指定 MSI 產品代碼。 此產品代碼為 GUID 格式。

Windows 來源管理可讓此部署類型所代表的 .MSI,從可用發佈點上的內容來源檔案自動更新或修復。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-UninstallCommand

指定要卸載應用程式的命令行。

從 2006 版開始,您可以指定空字串。

類型:String
別名:UninstallationProgram
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-UninstallContentLocation

指定來源內容的網路路徑,以搭配與 ContentLocation 不同的 UninstallCommand 使用。 當您將 UninstallOption 設定為 Different時,請使用此參數。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-UninstallOption

指定要搭配 UninstallCommand 使用的內容:

  • SameAsInstall:安裝和卸載內容相同。 此選項為預設值。
  • NoneRequired:應用程式不需要卸載內容。
  • Different:卸載內容與安裝內容不同。 使用 UninstallContentLocation 指定用來卸載應用程式之內容的網路路徑。
類型:UninstallContentSetting
接受的值:SameAsInstall, NoneRequired, Different
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-UninstallWorkingDirectory

指定客戶端執行 UninstallCommand 時要作為工作目錄的路徑。

類型:String
別名:UninstallationStartIn, UninstallFolder
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-UserInteractionMode

指定安裝程式可見度:

  • Normal:部署類型會根據系統和程序預設值,以一般模式執行。 此模式為預設值。
  • Minimized:部署類型會在用戶端裝置上最小化執行。 使用者可能會在通知區域或任務欄中看到安裝活動。
  • Maximized:部署類型會在用戶端裝置上最大化執行。 使用者會看到所有安裝活動。
  • Hidden:部署類型會在用戶端裝置上隱藏執行。 使用者看不到任何安裝活動。
類型:UserInteractionMode
別名:InstallationProgramVisibility
接受的值:Normal, Minimized, Maximized, Hidden
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-WhatIf

顯示執行 Cmdlet 時會發生什麼情況。 Cmdlet 不會執行。

類型:SwitchParameter
別名:wi
Position:Named
預設值:False
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

輸出

System.Object