3

使用:

import-module DataProtectionManager
import-module DPMExtendedCmdlets

我可以访问 cmdletNew-DPMRecoveryPoint

在 Microsoft 文档中,它说有一个名为DiskRecoveryPointOption https://technet.microsoft.com/en-us/library/hh881586(v=sc.20).aspx的参数

然而,当使用这个参数时,它似乎错误地说“找不到参数”

也奇怪。对此使用“Get-Help”Cmdlet 似乎未显示此参数?

我正在使用 DPM 2012R2(这是该 cmdlet 的 microsoft 页面上说明的版本)

我的用法也是这样的......

New-DPMRecoveryPoint -Datasource $ds -Disk -DiskRecoveryPointOption withsynchronize

谁能告诉我为什么我不能使用这个参数?

4

1 回答 1

2

奇怪的是,似乎有两种不同的实现New-DPMRecoveryPoint

Import-Module DataProtectionManager
Get-Command -Module DataProtectionManager -Name New-DPMRecoveryPoint
Remove-Module DataProtectionManager

Import-Module DPMExtendedCmdlets
Get-Command -Module DPMExtendedCmdlets    -Name New-DPMRecoveryPoint
Remove-Module DPMExtendedCmdlets

结果如下:

CommandType    Name                   ModuleName                      
-----------    ----                   ----------                      
Cmdlet         New-DPMRecoveryPoint   DataProtectionManager           
Cmdlet         New-DPMRecoveryPoint   DPMExtendedCmdlets             

您可以检查每个模块的实施帮助:

foreach ( $moduleName in 'DataProtectionManager','DPMExtendedCmdlets')
{
    Write-Host "#### ModuleName: $moduleName ####"
    Import-Module $moduleName
    help New-DPMRecoveryPoint
    Remove-Module $moduleName
}

它显示DataProtectionManager\New-DPMRecoveryPoint有一个参数集如下:

New-DPMRecoveryPoint [-Datasource] <Datasource[]> [-AdhocJobsContext <AdhocJobsContext>] 
[-BackupType <BackupType>] [-JobStateChangedEventHandler <JobStateChangedEventHandler>] 
[-WithDataIntegrityCheck] -Disk [-Confirm] [-WhatIf] [<CommonParameters>]

这与在线文档非常接近,但并不完全匹配。您可以获得与您安装的实现相匹配的文档,如下所示:

Get-Module | Remove-Module
Import-Module DataProtectionManager
help New-DPMRecoveryPoint -Full
于 2015-10-09T15:32:40.487 回答