{"content":"<div></div>","rawMetadata":{"metadata":{"_op_canonicalUrlPrefix":"https://learn.microsoft.com/ja-jp/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":"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/06/25","updated_at_date_time":"2026-06-25T23:37:36.5096561Z"},"_path":"module/configurationmanager/new-cmtsstepruncommandline.json","_rel":"../../","_tocRel":"../sccm-ps/toc.json","apiPlatform":"powershell","author":"Banreet","breadcrumb_path":"/powershell/sccm/bread/toc.json","canonical_url":"https://learn.microsoft.com/ja-jp/powershell/module/configurationmanager/new-cmtsstepruncommandline?view=sccm-ps","content_git_url":"https://github.com/MicrosoftDocs/sccm-docs-powershell-ref/blob/main/sccm-ps/ConfigurationManager/New-CMTSStepRunCommandLine.md","default_moniker":"sccm-ps","depot_name":"MSDN.sccm-powershell","document_id":"1c71c77c-fc77-bb79-08ab-ff0873c065da","document_version_independent_id":"d4df6662-eadb-815f-a79f-f77c3beb02b0","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":"62e555aa39764a14ca841753bfe1cb32f721e6b3","gitcommit":"https://github.com/MicrosoftDocs/sccm-docs-powershell/blob/62e555aa39764a14ca841753bfe1cb32f721e6b3/sccm-ps/ConfigurationManager/New-CMTSStepRunCommandLine.md","github_contributors":["aczechowski","damabe","ChrisKibble","sankethka"],"locale":"ja-jp","manager":"laurawi","Module Name":"ConfigurationManager","monikers":["sccm-ps"],"ms.author":"dannygu","ms.date":"08/31/2021","ms.service":"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-CMTSStepRunCommandLine.md","original_content_git_url_template":"{repo}/blob/{branch}/sccm-ps/ConfigurationManager/New-CMTSStepRunCommandLine.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-06-25 11:37 PM","xrefs":[{"href":"https://learn.microsoft.com/powershell/module/configurationmanager/new-cmtsstepruncommandline","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"New-CMTSStepRunCommandLine","schemaType":"PowershellCmdlet","summary":"<p>コマンド <strong>ラインの実行</strong> ステップを作成します。タスク シーケンスに追加できます。</p>\n","uid":"ConfigurationManager.New-CMTSStepRunCommandLine"}],"ocv-translation-feedback":true},"_xrefmap":{"ConfigurationManager":{"href":"./","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"ConfigurationManager","schemaType":"PowershellModule","uid":"ConfigurationManager"},"ConfigurationManager.New-CMTSStepRunCommandLine":{"href":"new-cmtsstepruncommandline","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"New-CMTSStepRunCommandLine","schemaType":"PowershellCmdlet","summary":"<p>コマンド <strong>ラインの実行</strong> ステップを作成します。タスク シーケンスに追加できます。</p>\n","uid":"ConfigurationManager.New-CMTSStepRunCommandLine"}},"description":"<p>このコマンドレットは、新しい <strong>コマンド ライン実行</strong> ステップ オブジェクトを作成します。 次に、 <a href=\"add-cmtasksequencestep\">Add-CMTaskSequenceStep</a> コマンドレットを使用して、タスク シーケンスにステップを追加します。 この手順の詳細については、「 <a href=\"/mem/configmgr/osd/understand/task-sequence-steps#BKMK_RunCommandLine\">タスク シーケンスの手順について: コマンド ラインを実行</a>する」を参照してください。</p>\n<div class=\"NOTE\">\n<p>注:</p>\n<p>\n              <code>PS XYZ:\\&gt;</code>など、Configuration Manager サイト ドライブから Configuration Manager コマンドレットを実行します。 詳細については、「作業の <a href=\"/powershell/sccm/overview\">開始</a>」を参照してください。</p>\n</div>\n","examples":[{"code":"$step = New-CMTSStepRunCommandLine -Name \"Run Command Line\" -CommandLine \"cmd.exe /c copy Jan98.dat c:\\sales\\Jan98.dat\" -PackageId \"XYZ00821\"\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>コマンド ラインの実行</strong> ステップのオブジェクトを作成します。 使用するコマンド ラインとパッケージを指定します。</p>\n<p>次に、タスク シーケンス オブジェクトを取得し、インデックス 11 のタスク シーケンスにこの新しいステップを追加します。</p>\n","title":"例 1"}],"inputs":[{"description":"","name":"<span class=\"no-loc xref\">None</span>\n"}],"links":[{"href":"get-cmtsstepruncommandline","text":"Get-CMTSStepRunCommandLine"},{"href":"remove-cmtsstepruncommandline","text":"Remove-CMTSStepRunCommandLine"},{"href":"set-cmtsstepruncommandline","text":"Set-CMTSStepRunCommandLine"},{"href":"/mem/configmgr/osd/understand/task-sequence-steps#BKMK_RunCommandLine","text":"タスク シーケンスの手順について: コマンド ラインを実行する"}],"module":"ConfigurationManager","name":"New-CMTSStepRunCommandLine","notes":"<p>この戻りオブジェクトとそのプロパティの詳細については、「 <a href=\"/mem/configmgr/develop/reference/osd/sms_tasksequence_runcommandlineaction-server-wmi-class\">サーバー WMI クラスSMS_TaskSequence_RunCommandLineAction</a>」を参照してください。</p>\n","outputs":[{"description":"","name":"<span class=\"no-loc xref\">IResultObject</span>\n"}],"parameters":[{"aliases":"","defaultValue":"None","description":"<p>タスク シーケンスを実行するコマンド ラインを指定します。 \n              <code>.exe</code>など、ファイル名拡張子を含めます。 必要なすべての設定ファイルとコマンド ライン オプションを含めます。</p>\n<p>例: <code>cmd.exe /c copy Jan98.dat c:\\sales\\Jan98.dat</code></p>\n","isRequired":true,"name":"CommandLine","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"Conditions","defaultValue":"None","description":"<p>この手順で使用する条件オブジェクトを指定します。 このオブジェクトを取得するには、タスク シーケンス条件コマンドレットのいずれかを使用します。 たとえば、 <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":"cf","defaultValue":"None","description":"<p>コマンドレットを実行する前に確認メッセージを表示します。</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":"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>このパラメーターは、ワイルドカード文字をリテラル文字の値として扱います。 \n              <strong>ForceWildcardHandling</strong> と組み合わせることはできません。</p>\n","name":"DisableWildcardHandling","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"},{"aliases":"DisableRedirectionFor64BitFileSystem","defaultValue":"None","description":"<p>既定では、64 ビット オペレーティング システムは WOW64 ファイル システム リダイレクターを使用してコマンド ラインを実行します。 この動作は、32 ビット バージョンの OS 実行可能ファイルとライブラリを適切に見つけることです。 WOW64 ファイル システム リダイレクターの使用を無効にするには、このパラメーターを追加します。 Windows は、ネイティブの 64 ビット バージョンの OS 実行可能ファイルとライブラリを使用してコマンドを実行します。 32 ビット OS で実行する場合、このオプションは無効です。</p>\n","name":"DisableWow64Redirection","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>このパラメーターはワイルドカード文字を処理し、予期しない動作が発生する可能性があります (推奨されません)。 \n              <strong>DisableWildcardHandling</strong> と組み合わせることはできません。</p>\n","name":"ForceWildcardHandling","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</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":"Output, OutputVariable","defaultValue":"None","description":"<p>カスタム タスク シーケンス変数の名前を指定します。 このパラメーターを使用すると、コマンド出力の最後の 1,000 文字が変数に保存されます。</p>\n","name":"OutputVariableName","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>コピー先のコンピューターにまだ存在しないファイルまたはプログラムをコマンド ラインで指定する場合は、このパラメーターを使用して、必要なファイルを含む <strong>パッケージのパッケージ ID を</strong> 指定します。 パッケージにはプログラムは必要ありません。 指定したファイルがコピー先のコンピューターに存在する場合、このオプションは必要ありません。</p>\n<p>この値は、 <code>XYZ00821</code>などの標準パッケージ ID です。</p>\n","name":"PackageId","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>コマンド ラインをローカル システム アカウントではなく Windows ユーザー アカウントとして実行するには、このパラメーターを追加します。 次に、 <strong>UserName</strong> パラメーターと <strong>UserPassword パラメーターを</strong> 使用します。</p>\n","name":"RunAsUser","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"},{"aliases":"SuccessCodes","defaultValue":"None","description":"<p>ステップが成功と評価するコマンドの終了コードとして整数値の配列を指定します。</p>\n","name":"SuccessCode","parameterValueGroup":"","position":"Named","type":"<p><span class=\"no-loc xref\">Int32</span><span>[</span><span>]</span></p>\n"},{"aliases":"TimeoutInMinutes","defaultValue":"None","description":"<p>Configuration Manager でコマンド ラインの実行が許可される時間を表す整数値を指定します。 この値は、 <code>1</code> 分から <code>999</code> 分までです。 既定値は <code>15</code> 分です。</p>\n<p>指定したコマンドが正常に完了するのに十分な時間を許可しない値を入力すると、この手順は失敗します。 ステップまたはグループの条件によっては、タスク シーケンス全体が失敗する可能性があります。 タイムアウトが切れた場合、Configuration Manager はコマンド ライン プロセスを終了します。</p>\n","name":"Timeout","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">Int32</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>\n              <strong>RunAsUser</strong> パラメーターを使用する場合は、このパラメーターを使用して Windows ユーザー アカウントの名前を指定します。 アカウント パスワードを指定するには、 <strong>UserPassword</strong> パラメーターを使用します。</p>\n","name":"UserName","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>\n              <strong>RunAsUser</strong> パラメーターを使用する場合は、このパラメーターを使用して、<strong>UserName</strong> で指定するアカウントのパスワードを指定します。</p>\n","name":"UserPassword","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SecureString</span>\n"},{"aliases":"wi","defaultValue":"None","description":"<p>コマンドレットが実行されるとどうなるかを示します。 コマンドレットは実行されません。</p>\n","name":"WhatIf","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"},{"aliases":"StartIn","defaultValue":"None","description":"<p>コマンドを開始するフォルダーを指定します。 このパスは最大 127 文字です。</p>\n","name":"WorkingDirectory","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"}],"schema":"PowershellCmdlet","summary":"<p>コマンド <strong>ラインの実行</strong> ステップを作成します。タスク シーケンスに追加できます。</p>\n","syntaxes":["New-CMTSStepRunCommandLine -CommandLine <String> [-DisableWow64Redirection] [-PackageId <String>] [-RunAsUser]\n [-SuccessCode <Int32[]>] [-Timeout <Int32>] [-UserName <String>] [-UserPassword <SecureString>]\n [-WorkingDirectory <String>] [-Condition <IResultObject[]>] [-ContinueOnError] [-Description <String>]\n [-Disable] -Name <String> [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]\n [<CommonParameters>]","New-CMTSStepRunCommandLine -CommandLine <String> [-DisableWow64Redirection] [-OutputVariableName <String>]\n [-PackageId <String>] [-RunAsUser] [-SuccessCode <Int32[]>] [-Timeout <Int32>] [-UserName <String>]\n [-UserPassword <SecureString>] [-WorkingDirectory <String>] [-Condition <IResultObject[]>] [-ContinueOnError]\n [-Description <String>] [-Disable] [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]\n [<CommonParameters>]","New-CMTSStepRunCommandLine -CommandLine <String> [-DisableWow64Redirection] [-OutputVariableName <String>]\n [-PackageId <String>] [-RunAsUser] [-SuccessCode <Int32[]>] [-Timeout <Int32>] [-UserName <String>]\n [-UserPassword <SecureString>] [-WorkingDirectory <String>] [-Condition <IResultObject[]>] [-ContinueOnError]\n [-Description <String>] [-Disable] [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]\n [<CommonParameters>]"],"uid":"ConfigurationManager.New-CMTSStepRunCommandLine","hideEdit":true,"ms.translationtype":"MT","ms.contentlocale":"ja-jp","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-CMTSStepRunCommandLine.md","xrefs":[{"href":"https://learn.microsoft.com/powershell/module/configurationmanager/new-cmtsstepruncommandline","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"New-CMTSStepRunCommandLine","schemaType":"PowershellCmdlet","summary":"<p>コマンド <strong>ラインの実行</strong> ステップを作成します。タスク シーケンスに追加できます。</p>\n","uid":"ConfigurationManager.New-CMTSStepRunCommandLine"}],"canonical_url":"https://learn.microsoft.com/ja-jp/powershell/module/configurationmanager/new-cmtsstepruncommandline?view=sccm-ps","_op_canonicalUrl":"https://learn.microsoft.com/ja-jp/powershell/module/configurationmanager/new-cmtsstepruncommandline?view=sccm-ps"},"pageMetadata":"<meta name=\"description\" content=\"<p>このコマンドレットは、新しい <strong>コマンド ライン実行</strong> ステップ オブジェクトを作成します。 次に、 <a href=&quot;add-cmtasksequencestep&quot;>Add-CMTaskSequenceStep</a> コマンドレットを使用して、タスク シーケンスにステップを追加します。 この手順の詳細については、「 <a href=&quot;/mem/configmgr/osd/understand/task-sequence-steps#BKMK_RunCommandLine&quot;>タスク シーケンスの手順について: コマンド ラインを実行</a>する」を参照してください。</p>\n<div class=&quot;NOTE&quot;>\n<p>注:</p>\n<p>\n              <code>PS XYZ:\\&amp;gt;</code>など、Configuration Manager サイト ドライブから Configuration Manager コマンドレットを実行します。 詳細については、「作業の <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-CMTSStepRunCommandLine.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=\"ja-jp\" />\r\n<meta name=\"ms.translationtype\" content=\"MT\" />\r\n<meta name=\"name\" content=\"New-CMTSStepRunCommandLine\" />\r\n<meta name=\"notes\" content=\"<p>この戻りオブジェクトとそのプロパティの詳細については、「 <a href=&quot;/mem/configmgr/develop/reference/osd/sms_tasksequence_runcommandlineaction-server-wmi-class&quot;>サーバー WMI クラスSMS_TaskSequence_RunCommandLineAction</a>」を参照してください。</p>\n\" />\r\n<meta name=\"schema\" content=\"PowershellCmdlet\" />\r\n<meta name=\"summary\" content=\"<p>コマンド <strong>ラインの実行</strong> ステップを作成します。タスク シーケンスに追加できます。</p>\n\" />\r\n<meta name=\"syntaxes\" content=\"New-CMTSStepRunCommandLine -CommandLine <String> [-DisableWow64Redirection] [-PackageId <String>] [-RunAsUser]\n [-SuccessCode <Int32[]>] [-Timeout <Int32>] [-UserName <String>] [-UserPassword <SecureString>]\n [-WorkingDirectory <String>] [-Condition <IResultObject[]>] [-ContinueOnError] [-Description <String>]\n [-Disable] -Name <String> [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]\n [<CommonParameters>]\" />\r\n<meta name=\"syntaxes\" content=\"New-CMTSStepRunCommandLine -CommandLine <String> [-DisableWow64Redirection] [-OutputVariableName <String>]\n [-PackageId <String>] [-RunAsUser] [-SuccessCode <Int32[]>] [-Timeout <Int32>] [-UserName <String>]\n [-UserPassword <SecureString>] [-WorkingDirectory <String>] [-Condition <IResultObject[]>] [-ContinueOnError]\n [-Description <String>] [-Disable] [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]\n [<CommonParameters>]\" />\r\n<meta name=\"syntaxes\" content=\"New-CMTSStepRunCommandLine -CommandLine <String> [-DisableWow64Redirection] [-OutputVariableName <String>]\n [-PackageId <String>] [-RunAsUser] [-SuccessCode <Int32[]>] [-Timeout <Int32>] [-UserName <String>]\n [-UserPassword <SecureString>] [-WorkingDirectory <String>] [-Condition <IResultObject[]>] [-ContinueOnError]\n [-Description <String>] [-Disable] [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]\n [<CommonParameters>]\" />\r\n<meta name=\"uid\" content=\"ConfigurationManager.New-CMTSStepRunCommandLine\" />\r\n","themesRelativePathToOutputRoot":"_themes/"}