在使用 Copy-DbaAgentJob dbatools cmd 时,需要将什么传递给参数Job
- 它是一个包含要复制的作业名称的数组
- 它是来自 cmd 的实际作业数组吗
Get-DbaAgentJob
在使用 Copy-DbaAgentJob dbatools cmd 时,需要将什么传递给参数Job
Get-DbaAgentJob根据Get-Help Copy-DbaAgentJob:
Copy-DbaAgentJob
[[-Source] <DbaInstanceParameter>]
[[-SourceSqlCredential] <PSCredential>]
[-Destination] <DbaInstanceParameter[]>
[[-DestinationSqlCredential] <PSCredential>]
[[-Job] <Object[]>]
[[-ExcludeJob] <Object[]>]
[-DisableOnSource]
[-DisableOnDestination]
[-Force]
[[-InputObject] <Job[]>]
[-EnableException]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
该-Job参数是一个对象数组,但更具体地说Get-Help Copy-DbaAgentJob -Detailed是:
-Job [<System.Object[]>]
The job(s) to process. This list is auto-populated from the server.
If unspecified, all jobs will be processed.
提供的示例之一Get-Help Copy-DbaAgentJob -Examples还表明您可以提供来自源服务器的现有作业列表,过滤或其他方式:
Get-DbaAgentJob -SqlInstance sqlserver2014a |
Where-Object Category -eq "Report Server" |
Copy-DbaAgentJob -Destination sqlserver2014b