Why is there a Parameter missing from "New-DPMRecoveryPoint" cmdlet in Powershell? (DPM Module)

359 Views Asked by At

Using:

import-module DataProtectionManager
import-module DPMExtendedCmdlets

I have access to the cmdlet New-DPMRecoveryPoint

In the Microsoft Documentation it says there is a parameter called DiskRecoveryPointOption https://technet.microsoft.com/en-us/library/hh881586(v=sc.20).aspx

However, When using this parameter it seems it errors saying 'parameter not found'

Strangely also. Using the 'Get-Help' Cmdlet on this seems that this paramter is not shown?

I am using DPM 2012R2 (Which is the version stated on the microsoft page for this cmdlet)

Also my usage is like this...

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

Can anyone tell me why I am unable to use this parameter?

1

There are 1 best solutions below

1
On BEST ANSWER

Strangely there seems to be two different implementations of 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

Which results in the following:

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

You can inspect the help for the implementation from each of those modules:

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

It reveals that DataProtectionManager\New-DPMRecoveryPoint has a parameter set as follows:

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

That's a close-but-not-exact match to the online documentation. You can get the documentation that matches your installed implementation like this:

Get-Module | Remove-Module
Import-Module DataProtectionManager
help New-DPMRecoveryPoint -Full