{"content":"<div></div>","rawMetadata":{"metadata":{"_op_canonicalUrlPrefix":"https://learn.microsoft.com/zh-tw/powershell/","_op_gitContributorInformation":{"author":{"display_name":"Banreet Kaur","id":"92906285","name":"Banreet","profile_url":"https://github.com/Banreet"},"contributors":[{"display_name":"Aaron Czechowski","id":"26784733","name":"aczechowski","profile_url":"https://github.com/aczechowski"}],"update_at":"2026/8/3","updated_at_date_time":"2026-08-03T07:37:44.0399941Z"},"_path":"module/configurationmanager/add-cmcidetectionmethod.json","_rel":"../../","_tocRel":"../sccm-ps/toc.json","apiPlatform":"powershell","author":"Banreet","breadcrumb_path":"/powershell/sccm/bread/toc.json","canonical_url":"https://learn.microsoft.com/zh-tw/powershell/module/configurationmanager/add-cmcidetectionmethod?view=sccm-ps","content_git_url":"https://github.com/MicrosoftDocs/sccm-docs-powershell-ref/blob/main/sccm-ps/ConfigurationManager/Add-CMCIDetectionMethod.md","default_moniker":"sccm-ps","depot_name":"MSDN.sccm-powershell","document_id":"b8337cbd-4888-4dc3-ed44-07c7240fddab","document_version_independent_id":"b7b0d7bc-1e3e-59ff-48e4-6ccc39d42ccc","external help file":"AdminUI.PS.dll-Help.xml","feedback_product_url":"https://feedbackportal.microsoft.com/feedback/forum/4669adfc-ee1b-ec11-b6e7-0022481f8472","feedback_system":"Standard","git_commit_id":"48cf632fb4b9ad92060012681a500478254de750","gitcommit":"https://github.com/MicrosoftDocs/sccm-docs-powershell/blob/48cf632fb4b9ad92060012681a500478254de750/sccm-ps/ConfigurationManager/Add-CMCIDetectionMethod.md","github_contributors":["aczechowski"],"locale":"zh-tw","manager":"laurawi","Module Name":"ConfigurationManager","monikers":["sccm-ps"],"ms.author":"dannygu","ms.date":"12/03/2020","ms.service":"microsoft-endpoint-configuration-manager","ms.subservice":"other","ms.topic":"reference","online version":"","open_to_public_contributors":true,"original_content_git_url":"https://github.com/MicrosoftDocs/sccm-docs-powershell/blob/live/sccm-ps/ConfigurationManager/Add-CMCIDetectionMethod.md","original_content_git_url_template":"{repo}/blob/{branch}/sccm-ps/ConfigurationManager/Add-CMCIDetectionMethod.md","PlatyPS schema version":"2.0.0","products":["https://authoring-docs-microsoft.poolparty.biz/devrel/f1499c3b-793f-48c3-a9ce-20285bcc6541"],"site_name":"Docs","titleSuffix":"Configuration Manager","uhfHeaderId":"MSDocsHeader-Powershell","updated_at":"2026-08-03 07:37 AM","xrefs":[{"href":"https://learn.microsoft.com/powershell/module/configurationmanager/add-cmcidetectionmethod","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"Add-CMCIDetectionMethod","schemaType":"PowershellCmdlet","summary":"<p>指定客戶端偵測應用程式方式。</p>\n","uid":"ConfigurationManager.Add-CMCIDetectionMethod"}],"ocv-translation-feedback":true},"_xrefmap":{"ConfigurationManager":{"href":"./","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"ConfigurationManager","schemaType":"PowershellModule","uid":"ConfigurationManager"},"ConfigurationManager.Add-CMCIDetectionMethod":{"href":"add-cmcidetectionmethod","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"Add-CMCIDetectionMethod","schemaType":"PowershellCmdlet","summary":"<p>指定客戶端偵測應用程式方式。</p>\n","uid":"ConfigurationManager.Add-CMCIDetectionMethod"}},"description":"<p>此 Cmdlet 會指定用戶端如何偵測裝置上的應用程式。 有三種偵測方法：Windows Installer 偵測、特定應用程式和部署類型的偵測，以及用來偵測應用程式的自定義腳本。</p>\n","examples":[{"code":"$ci = Get-CMConfigurationItem -Name \"testCI\"\n\n$msiFilePath = \"C:\\tools\\CCMTools\\Orca.Msi\"\n\n$ci | Add-CMCIDetectionMethod -DetectionOption Msi -MsiFilePath $msiFilePath","description":"","summary":"","title":"範例 1：Windows Installer 偵測"},{"code":"$ci = Get-CMConfigurationItem -Name \"testCI\"\n\n$ci | Add-CMCIDetectionMethod -DetectionOption DeploymentType -ApplicationName \"testApp\" -DeploymentTypeId \"392672\"","description":"","summary":"","title":"範例 2：特定應用程式和部署類型"},{"code":"$ci = Get-CMConfigurationItem -Name \"testCI\"\n\n$scriptFile  = \"C:\\share\\testScript.ps1\"\n\n$ci | Add-CMCIDetectionMethod -DetectionOption Script -ScriptLanguage PowerShell -ScriptFile $scriptFile","description":"","summary":"","title":"範例 3：自定義腳本偵測"}],"inputs":[{"description":"","name":"<span class=\"no-loc xref\">Microsoft.ConfigurationManagement.ManagementProvider.IResultObject</span>\n"}],"links":[{"href":"get-cmconfigurationitem","text":"Get-CMConfigurationItem"},{"href":"get-cmdeploymenttype","text":"Get-CMDeploymentType"}],"module":"ConfigurationManager","name":"Add-CMCIDetectionMethod","notes":"","outputs":[{"description":"","name":"<span class=\"no-loc xref\">System.Object</span>\n"}],"parameters":[{"aliases":"","defaultValue":"None","description":"<p>當您將 <strong>DetectionOption</strong> 設定為 <code>DeploymentType</code>時，請使用此參數來指定 Configuration Manager 應用程式的名稱。 搭配 <strong>DeploymentTypeID</strong> 使用此參數。</p>\n","name":"ApplicationName","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"cf","defaultValue":"None","description":"<p>執行 Cmdlet 之前提示您確認。</p>\n","name":"Confirm","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>當您將 <strong>DetectionOption</strong> 設定為 <code>DeploymentType</code>時，請使用此參數來指定 Configuration Manager 應用程式部署類型的標識碼。 搭配 <strong>ApplicationName</strong> 使用此參數。</p>\n<p>若要取得部署類型標識碼，請使用 <a href=\"get-cmdeploymenttype\">Get-CMDeploymentType</a> Cmdlet，並參考 <strong>CI_ID</strong> 屬性。</p>\n","name":"DeploymentTypeId","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>指定要使用的偵測方法。</p>\n","isRequired":true,"name":"DetectionOption","parameterValueGroup":"None, Msi, Script, DeploymentType","position":"Named","type":"<span class=\"no-loc xref\">ApplicationDetectionMethod</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>此參數會將通配符視為常值字元值。 您無法將其與 <strong>ForceWildcardHandling</strong> 結合。</p>\n","name":"DisableWildcardHandling","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>此參數會處理通配符，並可能導致非預期的行為 (不建議) 。 您無法將其與 <strong>DisableWildcardHandling</strong> 結合。</p>\n","name":"ForceWildcardHandling","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>指定應用程式部署類型的組態項目物件。 若要取得此物件，請使用 <a href=\"get-cmconfigurationitem\">Get-CMConfigurationItem</a>。</p>\n","isRequired":true,"name":"InputObject","parameterValueGroup":"","pipelineInput":true,"position":"0","type":"<span class=\"no-loc xref\">IResultObject</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>將此參數設定為 <code>$true</code> ，以指定每個使用者安裝此參數。</p>\n","name":"IsPerUserInstallation","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">Boolean</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>當您將 <strong>DetectionOption</strong> 設定為 <code>Msi</code>時，請使用此參數來指定 Windows Installer 檔案的路徑。</p>\n","name":"MsiFilePath","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>傳回 物件，表示您正在使用的專案。 根據預設，此 Cmdlet 可能不會產生任何輸出。</p>\n","name":"PassThru","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>當您將 <strong>DetectionOption</strong> 設定為 <code>Script</code>時，請使用此參數來指定文本的路徑。 搭配 <strong>ScriptLanguage</strong> 使用此參數。</p>\n","name":"ScriptFile","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"ScriptType","defaultValue":"None","description":"<p>當您將 <strong>DetectionOption</strong> 設定為 <code>Script</code>時，請使用此參數來指定腳本的語言。 搭配 <strong>ScriptFile</strong> 和 <strong>ScriptText</strong> 使用此參數。</p>\n","name":"ScriptLanguage","parameterValueGroup":"PowerShell, VBScript, JScript","position":"Named","type":"<span class=\"no-loc xref\">ScriptingLanguage</span>\n"},{"aliases":"ScriptContent","defaultValue":"None","description":"<p>當您將 <strong>DetectionOption</strong> 設定為 <code>Script</code>時，請使用此參數來指定文稿的文字。 搭配 <strong>ScriptLanguage</strong> 使用此參數。</p>\n","name":"ScriptText","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"wi","defaultValue":"None","description":"<p>顯示執行 Cmdlet 時會發生什麼情況。 Cmdlet 不會執行。</p>\n","name":"WhatIf","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"}],"schema":"PowershellCmdlet","summary":"<p>指定客戶端偵測應用程式方式。</p>\n","syntaxes":["Add-CMCIDetectionMethod [-InputObject] <IResultObject> -DetectionOption <ApplicationDetectionMethod>\n [-MsiFilePath <String>] [-IsPerUserInstallation <Boolean>] [-ScriptFile <String>]\n [-ScriptLanguage <ScriptingLanguage>] [-ScriptText <String>] [-ApplicationName <String>]\n [-DeploymentTypeId <String>] [-PassThru] [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf]\n [-Confirm] [<CommonParameters>]"],"uid":"ConfigurationManager.Add-CMCIDetectionMethod","hideEdit":true,"ms.translationtype":"MT","ms.contentlocale":"zh-tw","loc_version":"2024-08-21T21:18:36.7205003Z","loc_source_id":"Github-72476255#live","loc_file_id":"Github-72476255.live.MSDN.sccm-powershell.sccm-ps/ConfigurationManager/Add-CMCIDetectionMethod.md","xrefs":[{"href":"https://learn.microsoft.com/powershell/module/configurationmanager/add-cmcidetectionmethod","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"Add-CMCIDetectionMethod","schemaType":"PowershellCmdlet","summary":"<p>指定客戶端偵測應用程式方式。</p>\n","uid":"ConfigurationManager.Add-CMCIDetectionMethod"}],"canonical_url":"https://learn.microsoft.com/zh-tw/powershell/module/configurationmanager/add-cmcidetectionmethod?view=sccm-ps","_op_canonicalUrl":"https://learn.microsoft.com/zh-tw/powershell/module/configurationmanager/add-cmcidetectionmethod?view=sccm-ps"},"pageMetadata":"<meta name=\"description\" content=\"<p>此 Cmdlet 會指定用戶端如何偵測裝置上的應用程式。 有三種偵測方法：Windows Installer 偵測、特定應用程式和部署類型的偵測，以及用來偵測應用程式的自定義腳本。</p>\n\" />\r\n<meta name=\"hideEdit\" content=\"true\" />\r\n<meta name=\"loc_file_id\" content=\"Github-72476255.live.MSDN.sccm-powershell.sccm-ps/ConfigurationManager/Add-CMCIDetectionMethod.md\" />\r\n<meta name=\"loc_source_id\" content=\"Github-72476255#live\" />\r\n<meta name=\"loc_version\" content=\"2024-08-21T21:18:36.7205003Z\" />\r\n<meta name=\"module\" content=\"ConfigurationManager\" />\r\n<meta name=\"ms.contentlocale\" content=\"zh-tw\" />\r\n<meta name=\"ms.translationtype\" content=\"MT\" />\r\n<meta name=\"name\" content=\"Add-CMCIDetectionMethod\" />\r\n<meta name=\"notes\" content=\"\" />\r\n<meta name=\"schema\" content=\"PowershellCmdlet\" />\r\n<meta name=\"summary\" content=\"<p>指定客戶端偵測應用程式方式。</p>\n\" />\r\n<meta name=\"syntaxes\" content=\"Add-CMCIDetectionMethod [-InputObject] <IResultObject> -DetectionOption <ApplicationDetectionMethod>\n [-MsiFilePath <String>] [-IsPerUserInstallation <Boolean>] [-ScriptFile <String>]\n [-ScriptLanguage <ScriptingLanguage>] [-ScriptText <String>] [-ApplicationName <String>]\n [-DeploymentTypeId <String>] [-PassThru] [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf]\n [-Confirm] [<CommonParameters>]\" />\r\n<meta name=\"uid\" content=\"ConfigurationManager.Add-CMCIDetectionMethod\" />\r\n","themesRelativePathToOutputRoot":"_themes/"}