-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot process argument transformation on parameter 'Password'. Cannot convert the "password" value of type "System.String" to type "System.Security.SecureString". #27
Comments
Ah, yes. I was meaning to update the examples to use the new SecureString format. Try again with the updated script. |
Ok. I've tried with the updated script and it fails with another error: PS /home/user> ./datasource-bulk-import.ps1 ./cisco-import1.csv Name Value DataSourceType ciscoswitch ErrorRecord : Exception calling ".ctor" with "2" argument(s): "Cannot process argument because the value of argument "userName" is not valid. Change the value of the "userName" argument and run the operation again." My csv: DatasourceType;IP;Username;Password;Nickname;CISCO_SWITCHTYPE;SnmpCommunity |
Found the issue. You are missing $Username in PowerVRNI.psm1 @ |
I'm getting this error for all items in the csv while running the datasource-bulk-import.ps1 script.
Full Detail:
DataSourceType ciscoswitch
CiscoSwitchType CATALYST_4500
CollectorVMId 10000:901:4901612053106772451
Username network
Password password
IP 192.168.1.50
Nickname NICKNAME-1
[10/07/2021 16:28:03] Exception:
Message : Cannot process argument transformation on parameter 'Password'. Cannot convert the "password" value of type "System.String" to type "System.Security.SecureString".
ParameterName : Password
ParameterType : System.Security.SecureString
TypeSpecified : System.String
ErrorId : ParameterArgumentTransformationError
Line : 104
Offset : 33
CommandInvocation : System.Management.Automation.InvocationInfo
ErrorRecord : Cannot process argument transformation on parameter 'Password'. Cannot convert the "password" value of type "System.String" to type "System.Security.SecureString".
WasThrownFromThrowStatement : False
TargetSite : Void CheckActionPreference(System.Management.Automation.Language.FunctionContext, System.Exception)
StackTrace : at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) in
/PowerShell/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs:line 1655
at lambda_method250(Closure , Object[] , StrongBox
1[] , InterpretedFrame ) Data : {} InnerException : System.Management.Automation.ArgumentTransformationMetadataException: Cannot convert the "password" value of type "System.String" to type "System.Security.SecureString". ---> System.Management.Automation.PSInvalidCastException: Cannot convert the "password" value of type "System.String" to type "System.Security.SecureString". at System.Management.Automation.LanguagePrimitives.ThrowInvalidCastException(Object valueToConvert, Type resultType) in /PowerShell/src/System.Management.Automation/engine/LanguagePrimitives.cs:line 4911 at System.Management.Automation.LanguagePrimitives.ConvertNoConversion(Object valueToConvert, Type resultType, Boolean recurse, PSObject originalValueToConvert, IFormatProvider formatProvider, TypeTable backupTable) in /PowerShell/src/System.Management.Automation/engine/LanguagePrimitives.cs:line 4299 at System.Management.Automation.LanguagePrimitives.ConversionData
1.Invoke(Object valueToConvert, Type resultType, Boolean recurse, PSObject originalValueToConvert,IFormatProvider formatProvider, TypeTable backupTable) in /PowerShell/src/System.Management.Automation/engine/LanguagePrimitives.cs:line 4391
at System.Management.Automation.LanguagePrimitives.ConvertTo(Object valueToConvert, Type resultType, Boolean recursion, IFormatProvider formatProvider, TypeTable
backupTypeTable) in /PowerShell/src/System.Management.Automation/engine/LanguagePrimitives.cs:line 4850
at System.Management.Automation.LanguagePrimitives.ConvertTo(Object valueToConvert, Type resultType, IFormatProvider formatProvider) in
/PowerShell/src/System.Management.Automation/engine/LanguagePrimitives.cs:line 1739
at System.Management.Automation.ArgumentTypeConverterAttribute.Transform(EngineIntrinsics engineIntrinsics, Object inputData, Boolean bindingParameters, Boolean
bindingScriptCmdlet) in /PowerShell/src/System.Management.Automation/engine/ArgumentTypeConverterAttribute.cs:line 142
--- End of inner exception stack trace ---
at System.Management.Automation.ArgumentTypeConverterAttribute.Transform(EngineIntrinsics engineIntrinsics, Object inputData, Boolean bindingParameters, Boolean
bindingScriptCmdlet) in /PowerShell/src/System.Management.Automation/engine/ArgumentTypeConverterAttribute.cs:line 165
at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter parameterMetadata, ParameterBindingFlags
flags) in /PowerShell/src/System.Management.Automation/engine/ParameterBinderBase.cs:line 399
HelpLink :
Source : System.Management.Automation
HResult : -2146233087
The text was updated successfully, but these errors were encountered: