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"