Пример #1
0
 public override void ExecuteCmdlet()
 {
     ConfirmAction(
         string.Format(Resources.RemoveDataLakeAnalyticsCatalogCredential, Name),
         Name,
         () =>
     {
         DataLakeAnalyticsClient.DeleteCredential(Account, DatabaseName, Name, Password != null ? Password.GetNetworkCredential().Password : null);
         if (PassThru)
         {
             WriteObject(true);
         }
     });
 }
 public override void ExecuteCmdlet()
 {
     if (!Recurse)
     {
         ConfirmAction(
             string.Format(Resources.RemoveDataLakeAnalyticsCatalogCredential, Name),
             Name,
             () =>
         {
             DataLakeAnalyticsClient.DeleteCredential(
                 Account,
                 DatabaseName,
                 Name,
                 Password != null ? Password.GetNetworkCredential().Password : null);
             if (PassThru)
             {
                 WriteObject(true);
             }
         });
     }
     else // in the recursive case there are other objects deleted, so the user must take action
     {
         ConfirmAction(
             Force.IsPresent,
             string.Format(Resources.RemovingDataLakeAnalyticsCatalogCredentialCascade, Name),
             string.Format(Resources.RemoveDataLakeAnalyticsCatalogCredentialCascade, Name),
             Name,
             () =>
         {
             DataLakeAnalyticsClient.DeleteCredential(
                 Account,
                 DatabaseName,
                 Name, Password != null ? Password.GetNetworkCredential().Password : null,
                 Recurse);
             if (PassThru)
             {
                 WriteObject(true);
             }
         });
     }
 }