Import-SmaRunbook

Import-SmaRunbook

Imports a runbook into .

語法

Parameter Set: Default
Import-SmaRunbook -Path <String> -WebServiceEndpoint <String> [-AuthenticationType <String> ] [-Credential <PSCredential> ] [-Port <Int32> ] [-Tags <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

詳細描述

The Import-SmaRunbook cmdlet imports a runbook into . The runbook must be a Windows PowerShell script (.ps1) file. Specify the path of a runbook and the web service endpoint. If necessary, specify the port of the web service.

參數

-AuthenticationType<String>

Specifies the authentication type. Valid values are: Basic, Windows.

Windows is the default value. If you use Basic authentication, you must provide credentials by using the Credential parameter.

別名

必要?

false

位置?

named

預設值

Windows

接受管線輸入?

false

接受萬用字元?

false

-Credential<PSCredential>

Specifies user credentials, as a PSCredential object, to use for the connection to the web service. To obtain a credential object, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential.

別名

必要?

false

位置?

named

預設值

接受管線輸入?

false

接受萬用字元?

false

-Path<String>

Specifies the path to a runbook.

別名

RunbookPath

必要?

true

位置?

named

預設值

接受管線輸入?

false

接受萬用字元?

false

-Port<Int32>

Specifies the port number of the web service.

別名

必要?

false

位置?

named

預設值

接受管線輸入?

false

接受萬用字元?

false

-Tags<String>

Specifies one or more runbook tags. Provide all tags within one string, separated by commas.

別名

必要?

false

位置?

named

預設值

接受管線輸入?

false

接受萬用字元?

false

-WebServiceEndpoint<String>

Specifies the endpoint, as a URL, of the web service. Include the protocol, for example, http:// or https://.

別名

必要?

true

位置?

named

預設值

接受管線輸入?

false

接受萬用字元?

false

-Confirm

執行 Cmdlet 之前先提示您確認。

必要?

false

位置?

named

預設值

false

接受管線輸入?

false

接受萬用字元?

false

-WhatIf

顯示執行 Cmdlet 後會發生的情況。未執行 Cmdlet。

必要?

false

位置?

named

預設值

false

接受管線輸入?

false

接受萬用字元?

false

<CommonParameters>

此 Cmdlet 支援一般參數:-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer 與 -OutVariable。如需詳細資訊,請參閱 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

輸入

輸入類型是您可以使用管線處理方式傳遞給 Cmdlet 的物件類型。

輸出

輸出類型是 Cmdlet 所發出的物件類型。

範例

Example 1: Import a runbook into Service Management Automation

This command imports the runbook file named Runbook01.ps1 into the web service that has endpoint URL https://contoso.com/app01.

PS C:\> Import-SmaRunbook -Path "./Runbook01.ps1" -WebServiceEndpoint "https://contoso.com/app01"

相關主題

Edit-SmaRunbook

Get-SmaRunbook

Start-SmaRunbook

Publish-SmaRunbook

Remove-SmaRunbook