Get-AzRecoveryServicesVaultSettingsFile : Parameter set cannot be resolved using the specified named parameters.
Description
Unable to run Get-AzRecoveryServicesVaultSettingsFile : Parameter set cannot be resolved using the specified named parameters.
Steps to reproduce
Type Get-AzRecoveryServicesVaultSettingsFile error occurs, does not accept any parameters
Get-AzRecoveryServicesVaultSettingsFile : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Get-AzRecoveryServicesVaultSettingsFile
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-AzRecoveryServicesVaultSettingsFile], ParameterBindingExceptio
n
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.Azure.Commands.RecoveryServices.GetAzureRmRecoveryServic
esVaultSettingsFile
Environment data
Name Value
---- -----
PSVersion 5.1.17763.503
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.503
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Module versions
Get-InstalledModule -Name Az.RecoveryServices
Version Name Repository Description
------- ---- ---------- -----------
2.0.0-preview Az.RecoveryServices PSGallery Microsoft Azure PowerShell - Recovery ...
Debug output
PS C:\WINDOWS\system32> Get-AzRecoveryServicesVaultSettingsFile -Vault $ASR -Debug -Verbose
Get-AzRecoveryServicesVaultSettingsFile : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Get-AzRecoveryServicesVaultSettingsFile -Vault $ASR -Debug -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-AzRecoveryServicesVaultSettingsFile], ParameterBindingExceptio
n
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.Azure.Commands.RecoveryServices.GetAzureRmRecoveryServic
esVaultSettingsFile
Error output
Message : Parameter set cannot be resolved using the specified named parameters.
StackTrace : at System.Management.Automation.CmdletParameterBinderController.ThrowAmbiguousParameterSetException
(UInt32 parameterSetFlags, MergedCommandParameterMetadata bindableParameters)
at System.Management.Automation.CmdletParameterBinderController.ValidateParameterSets(Boolean
prePipelineInput, Boolean setDefault)
at
System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1
arguments)
at System.Management.Automation.CommandProcessor.BindCommandLineParameters()
at System.Management.Automation.CommandProcessor.Prepare(IDictionary psDefaultParameterValues)
at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary
psDefaultParameterValues)
at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object
input)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object
input)
at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput,
CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][]
commandRedirections, FunctionContext funcContext)
at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)
Exception : System.Management.Automation.ParameterBindingException
InvocationInfo : {Get-AzRecoveryServicesVaultSettingsFile}
Line : Get-AzRecoveryServicesVaultSettingsFile
Position : At line:1 char:1
+ Get-AzRecoveryServicesVaultSettingsFile
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 14
You need -Backup or -SiteRecovery. And -Certificate is a must.
(https://docs.microsoft.com/en-us/powershell/module/az.recoveryservices/get-azrecoveryservicesvaultsettingsfile?view=azps-2.4.0)
This command work perfectly fine with the AzureRM module
Get-AzurermRecoveryServicesVaultSettingsFile -Vault $vault -SiteRecovery -Path 'c:\something'
The problem is on the AZ module. Do we have to go back to the AzureRM modules?
Anyone on this?
@diegopietruszka: Unfortunately, due to underlying platform limitations, Az module requires a certificate whereas AzureRM does not. While we are pursuing this PS team, request you to kindly take a look at documentation where we provided an example and re-try.
https://docs.microsoft.com/azure/backup/backup-client-automation#registering-using-the-ps-az-module
Thanks for the answer, but makes no sense. I will stay with the azurerm module then, I'm using Azure to make things easier and simpler for us, don't need this kind of nonsense complications.
Any activity on this from Microsoft? Managing a self-signed certificate for the vault process is an extra hurdle that we don't need. This severely impedes my work to update all of our automation processes to the new Az module.
@marktheiii : Unfortunately, we still need a self-signed certificate for this with Az Module but we have fixed few issues with the command that may ease the problem a little bit. Please refer to this section for more details
https://docs.microsoft.com/azure/backup/backup-client-automation#registering-using-the-ps-az-module
@pvrk it is again broken.. not sure why this is soo much unreliable Get-AzRecoveryServicesVaultSettingsFile: X509Certificate is immutable on this platform. Use the equivalent constructor instead.
@vidyadharijami : Can you please check on this? @mganeshphani : We tested this internally and this works. Can you please share the version number and more details?
@mganeshphani Can you please use windows powershell instead of powershell core to check this.
Please refer below documentation to download vault cred file https://docs.microsoft.com/azure/backup/backup-client-automation#registering-using-the-ps-az-module
tried this but no luck. opened a new issue #12541
Closing this issue since this is tracked in the new issue.