Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
“为什么”中缺少一个参数;新DPMRecoveryPoint“;Powershell中的cmdlet?(DPM模块)_Powershell_Dpm - Fatal编程技术网

“为什么”中缺少一个参数;新DPMRecoveryPoint“;Powershell中的cmdlet?(DPM模块)

“为什么”中缺少一个参数;新DPMRecoveryPoint“;Powershell中的cmdlet?(DPM模块),powershell,dpm,Powershell,Dpm,使用: 我有权访问cmdletNew DPMRecoveryPoint 在Microsoft文档中,有一个名为DiskRecoveryPointOption 但是,当使用此参数时,显示“未找到参数”似乎是错误的 奇怪的是。在此服务器上使用“Get-Help”Cmdlet似乎未显示此参数 我正在使用DPM 2012R2(这是microsoft页面上为此cmdlet声明的版本) 我的用法也是这样的 import-module DataProtectionManager import-module

使用:

我有权访问cmdlet
New DPMRecoveryPoint

在Microsoft文档中,有一个名为
DiskRecoveryPointOption

但是,当使用此参数时,显示“未找到参数”似乎是错误的

奇怪的是。在此服务器上使用“Get-Help”Cmdlet似乎未显示此参数

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

我的用法也是这样的

import-module DataProtectionManager
import-module DPMExtendedCmdlets

有人能告诉我为什么不能使用这个参数吗?

奇怪的是,新的DPMRecoveryPoint有两种不同的实现方式:

New-DPMRecoveryPoint -Datasource $ds -Disk -DiskRecoveryPointOption withsynchronize
其结果如下:

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             
它显示
DataProtectionManager\New DPMRecoveryPoint
具有如下参数设置:

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

我没有答案,但我确认了您在我的DPM 2012R2实例上看到的内容。运行
(帮助新建DPMRecoveryPoint).parameters.parameter |%parameterSetName | select-Unique | measure |%count
显示,与您引用的文档中的四个参数相比,my live cmdlet上只有一个参数集。我想这个问题最好由technet论坛的MS来回答。如果你确实得到了答案,请至少在这里链接到它……我对解释很好奇。如果我发现任何东西,我都会大胆地知道。我确实发现,使用“DataProtectionManager\NewDPMRecoveryPoint”将我的错误切换到了其他错误。所以请试试这个。我知道现在发生了什么。我已经发布了答案。这是一个伟大的工作。请注意,您可以通过使用模块名反斜杠命令来完全限定命令名,如:
Microsoft.PowerShell.Core\Get command
,这也可以用于调用
Get Help
,因此您不必卸载/重新加载模块来获取各个版本的帮助。
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