3/1/2011 6:47:18 AM
 Peter C Posts: 16
|
Hi, We are successfully using a Powershell function to get Secrets. But when i try to add a secret i get a Errors.
When i try to call the function without the last parameter (FolderId) i get this Error:
Cannot find an overload for "AddSecret" and the argument count: "4". At Z:\PSadmin\LibPOIADM.ps1:1582 char:36 + $result = $SSConnection.AddSecret <<<< ($template.Id, "$secretName", $fields, $fieldValues) + CategoryInfo : NotSpecified: ( [], MethodException + FullyQualifiedErrorId : MethodCountCouldNotFindBest
------------ When i try to add the FolderId i getantohter Error. I tried for the last parameter: $Folder $Folder.Folder $Folder.Folder.id
[int32]$FolderId = 31 $Folder = $SSConnection.FolderGet($FolderId) $Folder.folder $SSConnection.AddSecret($template.Id, "$secretName", $fields, $fieldValues, $Folder) Id Name TypeId ParentFolderId -- ---- ------ -------------- 31 App-Diverse 1 1 Cannot convert argument "2", with value: "Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServic eProxy3vices_SSWinAuthWebService_asmx.SecretField[]", for "AddSecret" to type "System.Int32[]": "Cannot convert the "Mi crosoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy3vices_SSWinAuthWebService_asmx.Secret Field" value of type "Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy3vices_SSWinAu thWebService_asmx.SecretField" to type "System.Int32"." At Z:\PSadmin\LibPOIADM.ps1:4 char:36 + $result = $SSConnection.AddSecret <<<< ($template.Id, "$secretName", $fields, $fieldValues, $Folder.Folder) + CategoryInfo : NotSpecified: ( [], MethodException + FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument What do i do wrong?
Thank you! Peter Cermak
|
|
|
0
• link
|