3

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?

Harvey
  • 1,320
  • 3
  • 13
  • 33
  • I don't have an answer, but I confirmed what you are seeing on my instance of DPM 2012R2. Running `(help New-DPMRecoveryPoint).parameters.parameter | % parameterSetName | select -Unique | measure | % count` reveals that there is only one parameter set on my live cmdlet compared with four in the documentation you referenced. I suspect this question is best answered by MS in the technet forums. If you do get an answer please at least link to it here...I'm curious at the explanation. – alx9r Oct 09 '15 at 14:35
  • If i find anything I will defiantly know. What i did find incredibly perculiar is that using 'DataProtectionManager\NewDPMRecoveryPoint' switched my error to to something else. so please try this also – Harvey Oct 09 '15 at 14:40
  • Oh. I see what's going on now. I've posted an answer. – alx9r Oct 09 '15 at 15:33

1 Answers1

2

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
alx9r
  • 3,675
  • 4
  • 26
  • 55
  • This is great work. Note that you can fully qualify a command name by using the module name backslash command, like so: `Microsoft.PowerShell.Core\Get-Command` and this can also be used with calls to `Get-Help` so you don't have to unload/reload modules to get the help for the individual versions. – briantist Oct 09 '15 at 21:42