Set-ASRVaultContext Error
Hi,
When I am getting an error while executing below cmdlets:
###################### #Cmdlets ###################### $Vault = Get-AzureRMRecoveryServicesVault -ResourceGroupName $rgName -Name $VaultName Set-ASRVaultContext -vault $vault
########################
Error
######################## Set-AzureRmRecoveryServicesAsrVaultContext : Cannot bind parameter 'Vault'. Cannot convert the "Microsoft.Azure.Commands.RecoveryServices.ARSVault" value of type "Microsoft.Azure.Commands.RecoveryServices.ARSVault" to type "Microsoft.Azure.Commands.RecoveryServices.ARSVault". At line:2 char:28
- Set-ASRVaultContext -vault $vault
-
~~~~~~- CategoryInfo : InvalidArgument: (:) [Set-AzureRmReco...AsrVaultContext], ParameterBindingException
- FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.SetAz ureRmRecoveryServicesAsrVaultSettings
########################################################
Exception
########################################################
System.Management.Automation.ParameterBindingException: Cannot bind parameter 'Vault'. Cannot
convert the "Microsoft.Azure.Commands.RecoveryServices.ARSVault" value of type
"Microsoft.Azure.Commands.RecoveryServices.ARSVault" to type
"Microsoft.Azure.Commands.RecoveryServices.ARSVault". --->
System.Management.Automation.PSInvalidCastException: Cannot convert the
"Microsoft.Azure.Commands.RecoveryServices.ARSVault" value of type
"Microsoft.Azure.Commands.RecoveryServices.ARSVault" to type
"Microsoft.Azure.Commands.RecoveryServices.ARSVault".
at System.Management.Automation.LanguagePrimitives.ThrowInvalidCastException(Object
valueToConvert, Type resultType)
at System.Management.Automation.LanguagePrimitives.ConvertNoConversion(Object valueToConvert,
Type resultType, Boolean recurse, PSObject originalValueToConvert, IFormatProvider
formatProvider, TypeTable backupTable)
at System.Management.Automation.LanguagePrimitives.ConversionData1.Invoke(Object
valueToConvert, Type resultType, Boolean recurse, PSObject originalValueToConvert,
IFormatProvider formatProvider, TypeTable backupTable)
at System.Management.Automation.LanguagePrimitives.ConvertTo(Object valueToConvert, Type
resultType, Boolean recursion, IFormatProvider formatProvider, TypeTable backupTypeTable)
at
System.Management.Automation.ParameterBinderBase.CoerceTypeAsNeeded(CommandParameterInternal
argument, String parameterName, Type toType, ParameterCollectionTypeInformation
collectionTypeInfo, Object currentValue)
--- End of inner exception stack trace ---
at
System.Management.Automation.ParameterBinderBase.CoerceTypeAsNeeded(CommandParameterInternal
argument, String parameterName, Type toType, ParameterCollectionTypeInformation
collectionTypeInfo, Object currentValue)
at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal
parameter, CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)
at System.Management.Automation.CmdletParameterBinderController.BindParameter(CommandParameterI
nternal argument, MergedCompiledCommandParameter parameter, ParameterBindingFlags flags)
at System.Management.Automation.CmdletParameterBinderController.BindParameter(UInt32
parameterSets, CommandParameterInternal argument, MergedCompiledCommandParameter parameter,
ParameterBindingFlags flags)
at System.Management.Automation.CmdletParameterBinderController.BindParameters(UInt32
parameterSets, Collection1 arguments)
at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoVali
dation(Collection1 arguments)
at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Colle
ction1 arguments)
at System.Management.Automation.CommandProcessor.BindCommandLineParameters()
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)
##############################################################################
Please look into it. Thanks, Shubham Gupta
@viverm can you take a look?
@shubhamgupta514
Can you tell Module version of Get-AzureRmSiteRecoveryVaultSettings and Set-ASRVaultContext
get-command Get-AzureRmSiteRecoveryVaultSettings
get-command Set-ASRVaultContext
@viverm its resolved with the new module version AzureRM.RecoveryServices.SiteRecovery 0.1.6 Please close this issue
@shubhamgupta514 Thanks for Update.