{"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-03T08:26:14.9199077Z"},"_path":"module/configurationmanager/new-cmtsstepapplyoperatingsystem.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/new-cmtsstepapplyoperatingsystem?view=sccm-ps","content_git_url":"https://github.com/MicrosoftDocs/sccm-docs-powershell-ref/blob/main/sccm-ps/ConfigurationManager/New-CMTSStepApplyOperatingSystem.md","default_moniker":"sccm-ps","depot_name":"MSDN.sccm-powershell","document_id":"1a4bf11b-091c-8958-d9d6-6136ef6103f5","document_version_independent_id":"3f355ead-46f2-f362-a40e-67eb7f746d41","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/New-CMTSStepApplyOperatingSystem.md","github_contributors":["aczechowski"],"locale":"zh-tw","manager":"laurawi","Module Name":"ConfigurationManager","monikers":["sccm-ps"],"ms.author":"dannygu","ms.date":"08/04/2021","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/New-CMTSStepApplyOperatingSystem.md","original_content_git_url_template":"{repo}/blob/{branch}/sccm-ps/ConfigurationManager/New-CMTSStepApplyOperatingSystem.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 08:26 AM","xrefs":[{"href":"https://learn.microsoft.com/powershell/module/configurationmanager/new-cmtsstepapplyoperatingsystem","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"New-CMTSStepApplyOperatingSystem","schemaType":"PowershellCmdlet","summary":"<p>建立 [ <strong>套用 OS 映射</strong> ] 步驟，您可以將其新增至工作順序。</p>\n","uid":"ConfigurationManager.New-CMTSStepApplyOperatingSystem"}],"ocv-translation-feedback":true},"_xrefmap":{"ConfigurationManager":{"href":"./","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"ConfigurationManager","schemaType":"PowershellModule","uid":"ConfigurationManager"},"ConfigurationManager.New-CMTSStepApplyOperatingSystem":{"href":"new-cmtsstepapplyoperatingsystem","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"New-CMTSStepApplyOperatingSystem","schemaType":"PowershellCmdlet","summary":"<p>建立 [ <strong>套用 OS 映射</strong> ] 步驟，您可以將其新增至工作順序。</p>\n","uid":"ConfigurationManager.New-CMTSStepApplyOperatingSystem"}},"description":"<p>此 Cmdlet 會建立新的 <strong>套用 OS 映射</strong> 步驟物件。 然後使用 <a href=\"add-cmtasksequencestep\">Add-CMTaskSequenceStep</a> Cmdlet 將步驟新增至工作順序。 如需此步驟的詳細資訊，請 <a href=\"/mem/configmgr/osd/understand/task-sequence-steps#BKMK_ApplyOperatingSystemImage\">參閱關於工作順序步驟：套用OS映像</a>。</p>\n<div class=\"NOTE\">\n<p>注意事項</p>\n<p>從 Configuration Manager 月臺磁碟驅動器執行 Configuration Manager Cmdlet，例如 <code>PS XYZ:\\&gt;</code>。 如需詳細資訊，請 <a href=\"/powershell/sccm/overview\">參閱開始使用</a>。</p>\n</div>\n","examples":[{"code":"$osImgPkg = Get-CMOperatingSystemImage -Name \"OSImagePkg01\"\n$step = New-CMTSStepApplyOperatingSystem -Name \"Apply OS image\" -ImagePackage $osImgPkg -ImagePackageIndex 1\n\n$tsNameOsd = \"Default OS deployment\"\n$tsOsd = Get-CMTaskSequence -Name $tsNameOsd -Fast\n\n$tsOsd | Add-CMTaskSequenceStep -Step $step -InsertStepStartIndex 11","description":"","summary":"<p>此範例會先使用 <strong>Get-CMOperatingSystemImage</strong> Cmdlet 來取得 OS 映射套件的物件。 它會將這個物件儲存在 <strong>$osImgPkg</strong> 變數中。 下一個步驟會使用 <strong>$osImgPkg</strong> 對象作為映像套件，為 [<strong>套用OS映射</strong>] 步驟建立 物件。</p>\n<p>然後，它會取得工作順序物件，並將這個新步驟新增至索引 11 的工作順序。</p>\n","title":"範例 1"}],"inputs":[{"description":"","name":"<span class=\"no-loc xref\">None</span>\n"}],"links":[{"href":"get-cmtsstepapplyoperatingsystem","text":"Get-CMTSStepApplyOperatingSystem"},{"href":"remove-cmtsstepapplyoperatingsystem","text":"Remove-CMTSStepApplyOperatingSystem"},{"href":"set-cmtsstepapplyoperatingsystem","text":"Set-CMTSStepApplyOperatingSystem"},{"href":"/mem/configmgr/osd/understand/task-sequence-steps#BKMK_ApplyOperatingSystemImage","text":"關於工作順序步驟：套用OS映像"}],"module":"ConfigurationManager","name":"New-CMTSStepApplyOperatingSystem","notes":"<p>如需這個傳回物件及其屬性的詳細資訊，請 <a href=\"/mem/configmgr/develop/reference/osd/sms_tasksequence_applyoperatingsystemaction-server-wmi-class\">參閱SMS_TaskSequence_ApplyOperatingSystemAction伺服器 WMI 類別</a>。</p>\n","outputs":[{"description":"","name":"<span class=\"no-loc xref\">IResultObject</span>\n"}],"parameters":[{"aliases":"Conditions","defaultValue":"None","description":"<p>指定要與這個步驟搭配使用的條件物件。 若要取得這個物件，請使用其中一個工作順序條件 Cmdlet。 例如， <a href=\"get-cmtsstepconditionvariable\">Get-CMTSStepConditionVariable</a>。</p>\n","name":"Condition","parameterValueGroup":"","position":"Named","type":"<p><span class=\"no-loc xref\">IResultObject</span><span>[</span><span>]</span></p>\n"},{"aliases":"AnswerFileName","defaultValue":"None","description":"<p>指定自動或 Sysprep 回應檔案的檔案名，以用於自訂安裝。 使用此參數搭配 <strong>ConfigFilePackage</strong> 參數。</p>\n","name":"ConfigFileName","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"AnswerFilePackage","defaultValue":"None","description":"<p>指定套件物件，其中包含要用於自定義安裝的自動或 Sysprep 回應檔案。 若要取得此物件，請使用 <a href=\"get-cmpackage\">Get-CMPackage</a> Cmdlet。 使用此參數搭配 <strong>ConfigFileName</strong> 參數。</p>\n","name":"ConfigFilePackage","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">IResultObject</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>發生錯誤時繼續</strong>] 步驟選項。 當您啟用此選項時，如果步驟失敗，工作順序會繼續。</p>\n","name":"ContinueOnError","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>指定此工作順序步驟的選擇性描述。</p>\n","name":"Description","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>指定您要套用此 OS 的位置。 如果您未指定此參數，則預設值為 <code>NextAvailableFormattedPartition</code>。</p>\n<ul>\n<li><p>\n              <code>NextAvailableFormattedPartition</code>：使用此工作順序中[ <strong>套用操作系統</strong> ] 或 [ <strong>套用數據映射</strong> ] 步驟尚未設為目標的下一個循序數據分割。</p>\n</li>\n<li><p>\n              <code>SpecificDiskAndPartition</code>：使用 <strong>DestinationDisk</strong> 參數指定磁碟編號，並使用 <strong>DestinationPartition</strong> 參數指定分割區編號。</p>\n</li>\n<li><p>\n              <code>SpecificLogicalDriverLetter</code>：使用 <strong>DestinationDriveLetter</strong> 參數來指定 Windows PE 指派給分割區的邏輯驅動器號。 這個驅動器號可以與新部署的OS所指派的驅動器號不同。</p>\n</li>\n<li><p>\n              <code>LogicalDriverLetterInVariable</code>：使用 <strong>DestinationVariable</strong> 參數來指定工作順序變數，其中包含 Windows PE 指派給磁碟分區的驅動器號。 此變數通常是使用 <a href=\"set-cmtssteppartitiondisk\">Set-CMTSStepPartitionDisk</a> 或 <a href=\"new-cmtssteppartitiondisk\">New-CMTSStepPartitionDisk</a> Cmdlet 的 <strong>DiskNumberVariable</strong> 參數來設定，以進行<strong>格式化和分割磁碟</strong>工作順序步驟。</p>\n</li>\n</ul>\n","name":"Destination","parameterValueGroup":"NextAvailableFormattedPartition, SpecificDiskAndPartition, SpecificLogicalDriverLetter, LogicalDriverLetterInVariable","position":"Named","type":"<span class=\"no-loc xref\">DestinationType</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>當您使用 <code>-Destination SpecificDiskAndPartition</code>時，請使用此參數來指定磁碟編號。 指定從 <code>0</code> 到 <code>99</code>的整數。 也請使用 <strong>DestinationPartition</strong> 參數。</p>\n","name":"DestinationDisk","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">Int32</span>\n"},{"aliases":"DestinationLogicalDrive","defaultValue":"None","description":"<p>當您使用 <code>-Destination SpecificLogicalDriverLetter</code>時，請使用此參數來指定邏輯驅動器號。 指定從 <code>C</code> 到的 <code>Z</code>驅動器號。</p>\n","name":"DestinationDriveLetter","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>當您使用 <code>-Destination SpecificDiskAndPartition</code>時，請使用此參數來指定分割區編號。 指定從 <code>1</code> 到 <code>99</code>的整數。 也請使用 <strong>DestinationDisk</strong> 參數。</p>\n","name":"DestinationPartition","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">Int32</span>\n"},{"aliases":"DestinationVariableName","defaultValue":"None","description":"<p>當您使用 <code>-Destination LogicalDriverLetterInVariable</code>時，請使用此參數來指定具有邏輯驅動器號的工作順序變數。 變數名稱需要不含空格且少於 256 個字元的英數位元。</p>\n","name":"DestinationVariable","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"DisableThisStep","defaultValue":"None","description":"<p>新增此參數以停用此工作順序步驟。</p>\n","name":"Disable","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</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>指定 OS 映像套件物件。 此步驟會套用此映像中的OS。 使用 <strong>ImagePackageIndex</strong> 參數來設定影像索引。</p>\n<p>若要取得此物件，請使用 <a href=\"get-cmoperatingsystemimage\">Get-CMOperatingSystemImage</a> Cmdlet。</p>\n","name":"ImagePackage","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">IResultObject</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>指定影像索引的整數值。 搭配 <strong>ImagePackage</strong> 參數使用此參數。</p>\n","name":"ImagePackageIndex","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">Int32</span>\n"},{"aliases":"UpgradePackage","defaultValue":"None","description":"<p>指定 OS 升級套件物件。 此步驟會套用來自此原始安裝來源的OS。 使用 <strong>InstallPackageIndex</strong> 參數來設定版本。</p>\n<p>若要取得此物件，請使用 <a href=\"get-cmoperatingsysteminstaller\">Get-CMOperatingSystemInstaller</a> Cmdlet。</p>\n","name":"InstallPackage","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">IResultObject</span>\n"},{"aliases":"UpgradePackageIndex","defaultValue":"None","description":"<p>指定 OS 升級套件版本的整數值。 使用此參數搭配 <strong>InstallPackage</strong> 參數。</p>\n","name":"InstallPackageIndex","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">Int32</span>\n"},{"aliases":"KeyboardDriver","defaultValue":"None","description":"<p>從 2107 版開始，使用此參數來選取與日文和韓文語言通用的其他鍵盤類型。 為要與 Windows 一起安裝的分層驅動程式指定整數值。 使用與 <a href=\"/mem/configmgr/osd/understand/task-sequence-variables#OsdLayeredDriver\">OsdLayeredDriver</a> 工作順序變數相同的值。</p>\n","name":"LayeredDriver","parameterValueGroup":"DoNotSpecify, Driver1, Driver2, Driver3, Driver4, Driver5, Driver6","position":"Named","type":"<span class=\"no-loc xref\">OsdLayeredDriver</span>\n"},{"aliases":"StepName","defaultValue":"None","description":"<p>指定此步驟的名稱，以在工作順序中識別它。</p>\n","isRequired":true,"name":"Name","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"AllowAccessFromDistributionPoint","defaultValue":"None","description":"<p>將此參數設定為 <code>$true</code> ，以允許工作順序直接從發佈點套用OS映像。</p>\n<p>為了獲得最大的安全性，建議您不要啟用此設定。 此選項是專為在記憶體容量有限的裝置上使用而設計。 如需詳細資訊，請參 <a href=\"/mem/configmgr/osd/understand/task-sequence-steps#access-content-directly-from-the-distribution-point\">閱直接從發佈點存取內容</a>。</p>\n","name":"RunFromNet","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">Boolean</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>建立 [ <strong>套用 OS 映射</strong> ] 步驟，您可以將其新增至工作順序。</p>\n","syntaxes":["New-CMTSStepApplyOperatingSystem [-ConfigFileName <String>] [-ConfigFilePackage <IResultObject>]\n [-Destination <DestinationType>] [-DestinationDisk <Int32>] [-DestinationDriveLetter <String>]\n [-LayeredDriver <OsdLayeredDriver>] [-DestinationPartition <Int32>] [-DestinationVariable <String>]\n [-ImagePackage <IResultObject>] [-ImagePackageIndex <Int32>] [-InstallPackage <IResultObject>]\n [-InstallPackageIndex <Int32>] [-RunFromNet <Boolean>] [-Condition <IResultObject[]>] [-ContinueOnError]\n [-Description <String>] [-Disable] -Name <String> [-DisableWildcardHandling] [-ForceWildcardHandling]\n [-WhatIf] [-Confirm] [<CommonParameters>]"],"uid":"ConfigurationManager.New-CMTSStepApplyOperatingSystem","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/New-CMTSStepApplyOperatingSystem.md","xrefs":[{"href":"https://learn.microsoft.com/powershell/module/configurationmanager/new-cmtsstepapplyoperatingsystem","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"New-CMTSStepApplyOperatingSystem","schemaType":"PowershellCmdlet","summary":"<p>建立 [ <strong>套用 OS 映射</strong> ] 步驟，您可以將其新增至工作順序。</p>\n","uid":"ConfigurationManager.New-CMTSStepApplyOperatingSystem"}],"canonical_url":"https://learn.microsoft.com/zh-tw/powershell/module/configurationmanager/new-cmtsstepapplyoperatingsystem?view=sccm-ps","_op_canonicalUrl":"https://learn.microsoft.com/zh-tw/powershell/module/configurationmanager/new-cmtsstepapplyoperatingsystem?view=sccm-ps"},"pageMetadata":"<meta name=\"description\" content=\"<p>此 Cmdlet 會建立新的 <strong>套用 OS 映射</strong> 步驟物件。 然後使用 <a href=&quot;add-cmtasksequencestep&quot;>Add-CMTaskSequenceStep</a> Cmdlet 將步驟新增至工作順序。 如需此步驟的詳細資訊，請 <a href=&quot;/mem/configmgr/osd/understand/task-sequence-steps#BKMK_ApplyOperatingSystemImage&quot;>參閱關於工作順序步驟：套用OS映像</a>。</p>\n<div class=&quot;NOTE&quot;>\n<p>注意事項</p>\n<p>從 Configuration Manager 月臺磁碟驅動器執行 Configuration Manager Cmdlet，例如 <code>PS XYZ:\\&amp;gt;</code>。 如需詳細資訊，請 <a href=&quot;/powershell/sccm/overview&quot;>參閱開始使用</a>。</p>\n</div>\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/New-CMTSStepApplyOperatingSystem.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=\"New-CMTSStepApplyOperatingSystem\" />\r\n<meta name=\"notes\" content=\"<p>如需這個傳回物件及其屬性的詳細資訊，請 <a href=&quot;/mem/configmgr/develop/reference/osd/sms_tasksequence_applyoperatingsystemaction-server-wmi-class&quot;>參閱SMS_TaskSequence_ApplyOperatingSystemAction伺服器 WMI 類別</a>。</p>\n\" />\r\n<meta name=\"schema\" content=\"PowershellCmdlet\" />\r\n<meta name=\"summary\" content=\"<p>建立 [ <strong>套用 OS 映射</strong> ] 步驟，您可以將其新增至工作順序。</p>\n\" />\r\n<meta name=\"syntaxes\" content=\"New-CMTSStepApplyOperatingSystem [-ConfigFileName <String>] [-ConfigFilePackage <IResultObject>]\n [-Destination <DestinationType>] [-DestinationDisk <Int32>] [-DestinationDriveLetter <String>]\n [-LayeredDriver <OsdLayeredDriver>] [-DestinationPartition <Int32>] [-DestinationVariable <String>]\n [-ImagePackage <IResultObject>] [-ImagePackageIndex <Int32>] [-InstallPackage <IResultObject>]\n [-InstallPackageIndex <Int32>] [-RunFromNet <Boolean>] [-Condition <IResultObject[]>] [-ContinueOnError]\n [-Description <String>] [-Disable] -Name <String> [-DisableWildcardHandling] [-ForceWildcardHandling]\n [-WhatIf] [-Confirm] [<CommonParameters>]\" />\r\n<meta name=\"uid\" content=\"ConfigurationManager.New-CMTSStepApplyOperatingSystem\" />\r\n","themesRelativePathToOutputRoot":"_themes/"}