{"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"},{"display_name":"Sean Wheeler","id":"19415881","name":"sdwheeler","profile_url":"https://github.com/sdwheeler"},{"display_name":"Dan Mabee","id":"40476441","name":"damabe","profile_url":"https://github.com/damabe"},{"display_name":"Chris Kibble","id":"39386226","name":"ChrisKibble","profile_url":"https://github.com/ChrisKibble"},{"display_name":"sankethka","id":"16908144","name":"sankethka","profile_url":"https://github.com/sankethka"}],"update_at":"2026/8/3","updated_at_date_time":"2026-08-03T08:06:31.4497627Z"},"_path":"module/configurationmanager/get-cmtssteprunpowershellscript.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/get-cmtssteprunpowershellscript?view=sccm-ps","content_git_url":"https://github.com/MicrosoftDocs/sccm-docs-powershell-ref/blob/main/sccm-ps/ConfigurationManager/Get-CMTSStepRunPowerShellScript.md","default_moniker":"sccm-ps","depot_name":"MSDN.sccm-powershell","document_id":"994d8cb1-1d45-9c30-2107-d297153b5ca3","document_version_independent_id":"1261bff9-185b-bc6a-9f7c-9dd803168eb4","external help file":"AdminUI.PS.psm1-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/Get-CMTSStepRunPowerShellScript.md","github_contributors":["aczechowski","sdwheeler","damabe","ChrisKibble","sankethka"],"locale":"zh-tw","manager":"laurawi","Module Name":"ConfigurationManager","monikers":["sccm-ps"],"ms.author":"dannygu","ms.date":"08/31/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/Get-CMTSStepRunPowerShellScript.md","original_content_git_url_template":"{repo}/blob/{branch}/sccm-ps/ConfigurationManager/Get-CMTSStepRunPowerShellScript.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:06 AM","xrefs":[{"href":"https://learn.microsoft.com/powershell/module/configurationmanager/get-cmtssteprunpowershellscript","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"Get-CMTSStepRunPowerShellScript","schemaType":"PowershellCmdlet","summary":"<p>從特定工作順序取得執行 <strong>PowerShell腳本</strong> 步驟。</p>\n","uid":"ConfigurationManager.Get-CMTSStepRunPowerShellScript"}],"ocv-translation-feedback":true},"_xrefmap":{"ConfigurationManager":{"href":"./","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"ConfigurationManager","schemaType":"PowershellModule","uid":"ConfigurationManager"},"ConfigurationManager.Get-CMTSStepRunPowerShellScript":{"href":"get-cmtssteprunpowershellscript","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"Get-CMTSStepRunPowerShellScript","schemaType":"PowershellCmdlet","summary":"<p>從特定工作順序取得執行 <strong>PowerShell腳本</strong> 步驟。</p>\n","uid":"ConfigurationManager.Get-CMTSStepRunPowerShellScript"}},"description":"<p>使用此 Cmdlet 取得一或多個執行 <strong>PowerShell 腳本</strong> 步驟實例的工作順序步驟物件。 您可以使用此物件來：</p>\n<ul>\n<li>使用 <a href=\"remove-cmtssteprunpowershellscript\">Remove-CMTSStepRunPowerShellScript</a> 從工作順序移除步驟</li>\n<li>使用 <a href=\"add-cmtasksequencestep\">Add-CMTaskSequenceStep</a> 將步驟複製到另一個工作順序</li>\n</ul>\n<p>如需此步驟的詳細資訊，請 <a href=\"/mem/configmgr/osd/understand/task-sequence-steps#BKMK_RunPowerShellScript\">參閱關於工作順序步驟：執行 PowerShell 腳本</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":"$tsNameOsd = \"Default OS deployment\"\n$tsOsd = Get-CMTaskSequence -Name $tsNameOsd -Fast\n\n$tsStepNameRunPwsh = \"Run PowerShell Script\"\n$tsStepRunPwsh = Get-CMTSStepRunPowerShellScript -InputObject $tsOsd -StepName $tsStepNameRunPwsh","description":"","summary":"<p>這個範例會先取得 <strong>$tsOsd</strong> 變數中的工作順序物件。 然後，它會將該變數傳遞為輸入物件，以取得 <strong>執行 PowerShell 腳本</strong> 步驟。</p>\n","title":"範例 1"}],"inputs":[{"description":"","name":"<span class=\"no-loc xref\">Microsoft.ConfigurationManagement.ManagementProvider.IResultObject</span>\n"}],"links":[{"href":"new-cmtssteprunpowershellscript","text":"New-CMTSStepRunPowerShellScript"},{"href":"remove-cmtssteprunpowershellscript","text":"Remove-CMTSStepRunPowerShellScript"},{"href":"set-cmtssteprunpowershellscript","text":"Set-CMTSStepRunPowerShellScript"},{"href":"add-cmtasksequencestep","text":"Add-CMTaskSequenceStep"},{"href":"get-cmtasksequence","text":"Get-CMTaskSequence"},{"href":"/mem/configmgr/osd/understand/task-sequence-steps#BKMK_RunPowerShellScript","text":"關於工作順序步驟：執行 PowerShell 腳本"}],"module":"ConfigurationManager","name":"Get-CMTSStepRunPowerShellScript","notes":"","outputs":[{"description":"","name":"<span class=\"no-loc xref\">System.Object</span>\n"}],"parameters":[{"aliases":"cf","defaultValue":"None","description":"<p>執行 Cmdlet 之前提示您確認。</p>\n","name":"Confirm","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"},{"aliases":"TaskSequence","defaultValue":"None","description":"<p>指定要從中取得 <strong>執行 PowerShell 腳本</strong> 步驟的工作順序物件。 若要取得此物件，請使用 <a href=\"get-cmtasksequence\">Get-CMTaskSequence</a> Cmdlet。</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>指定要從工作順序取得的執行 <strong>PowerShell 腳本</strong> 步驟名稱。</p>\n","name":"StepName","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"Id, TaskSequencePackageId","defaultValue":"None","description":"<p>指定要從中取得<strong>執行 PowerShell 腳本</strong>步驟之工作順序的<strong>套件識別</strong>碼。 此值是標準套件識別碼，例如 <code>XYZ00858</code>。</p>\n","isRequired":true,"name":"TaskSequenceId","parameterValueGroup":"","position":"0","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>指定要從中取得 <strong>執行 PowerShell 腳本</strong> 步驟的工作順序名稱。</p>\n","isRequired":true,"name":"TaskSequenceName","parameterValueGroup":"","position":"0","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>從特定工作順序取得執行 <strong>PowerShell腳本</strong> 步驟。</p>\n","syntaxes":["Get-CMTSStepRunPowerShellScript [-InputObject] <IResultObject> [-StepName <String>] [-WhatIf] [-Confirm]\n [<CommonParameters>]","Get-CMTSStepRunPowerShellScript [-TaskSequenceId] <String> [-StepName <String>] [-WhatIf] [-Confirm]\n [<CommonParameters>]","Get-CMTSStepRunPowerShellScript [-TaskSequenceName] <String> [-StepName <String>] [-WhatIf] [-Confirm]\n [<CommonParameters>]"],"uid":"ConfigurationManager.Get-CMTSStepRunPowerShellScript","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/Get-CMTSStepRunPowerShellScript.md","xrefs":[{"href":"https://learn.microsoft.com/powershell/module/configurationmanager/get-cmtssteprunpowershellscript","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"Get-CMTSStepRunPowerShellScript","schemaType":"PowershellCmdlet","summary":"<p>從特定工作順序取得執行 <strong>PowerShell腳本</strong> 步驟。</p>\n","uid":"ConfigurationManager.Get-CMTSStepRunPowerShellScript"}],"canonical_url":"https://learn.microsoft.com/zh-tw/powershell/module/configurationmanager/get-cmtssteprunpowershellscript?view=sccm-ps","_op_canonicalUrl":"https://learn.microsoft.com/zh-tw/powershell/module/configurationmanager/get-cmtssteprunpowershellscript?view=sccm-ps"},"pageMetadata":"<meta name=\"description\" content=\"<p>使用此 Cmdlet 取得一或多個執行 <strong>PowerShell 腳本</strong> 步驟實例的工作順序步驟物件。 您可以使用此物件來：</p>\n<ul>\n<li>使用 <a href=&quot;remove-cmtssteprunpowershellscript&quot;>Remove-CMTSStepRunPowerShellScript</a> 從工作順序移除步驟</li>\n<li>使用 <a href=&quot;add-cmtasksequencestep&quot;>Add-CMTaskSequenceStep</a> 將步驟複製到另一個工作順序</li>\n</ul>\n<p>如需此步驟的詳細資訊，請 <a href=&quot;/mem/configmgr/osd/understand/task-sequence-steps#BKMK_RunPowerShellScript&quot;>參閱關於工作順序步驟：執行 PowerShell 腳本</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/Get-CMTSStepRunPowerShellScript.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=\"Get-CMTSStepRunPowerShellScript\" />\r\n<meta name=\"notes\" content=\"\" />\r\n<meta name=\"schema\" content=\"PowershellCmdlet\" />\r\n<meta name=\"summary\" content=\"<p>從特定工作順序取得執行 <strong>PowerShell腳本</strong> 步驟。</p>\n\" />\r\n<meta name=\"syntaxes\" content=\"Get-CMTSStepRunPowerShellScript [-InputObject] <IResultObject> [-StepName <String>] [-WhatIf] [-Confirm]\n [<CommonParameters>]\" />\r\n<meta name=\"syntaxes\" content=\"Get-CMTSStepRunPowerShellScript [-TaskSequenceId] <String> [-StepName <String>] [-WhatIf] [-Confirm]\n [<CommonParameters>]\" />\r\n<meta name=\"syntaxes\" content=\"Get-CMTSStepRunPowerShellScript [-TaskSequenceName] <String> [-StepName <String>] [-WhatIf] [-Confirm]\n [<CommonParameters>]\" />\r\n<meta name=\"uid\" content=\"ConfigurationManager.Get-CMTSStepRunPowerShellScript\" />\r\n","themesRelativePathToOutputRoot":"_themes/"}