0

在使用 Copy-DbaAgentJob dbatools cmd 时,需要将什么传递给参数Job

  • 它是一个包含要复制的作业名称的数组
  • 它是来自 cmd 的实际作业数组吗Get-DbaAgentJob
4

1 回答 1

0

根据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
于 2021-08-13T03:22:21.607 回答