Represents base class for all Azure cmdlets.
Inheritance: System.Management.Automation.PSCmdlet, IDisposable
 static void SafeAddToJobRepository(this AzurePSCmdlet cmdlet, Job job)
 {
     try
     {
         cmdlet.JobRepository.Add(job);
     }
     catch
     {
         // ignore errors in adding the job to the repository
     }
 }
Esempio n. 2
0
 public static void ExecuteWithProcessing(this AzurePSCmdlet cmdlt)
 {
     cmdlt.InvokeBeginProcessing();
     cmdlt.ExecuteCmdlet();
     cmdlt.InvokeEndProcessing();
 }
        public static void DisableDataCollection(this AzurePSCmdlet cmdlt)
        {
            PropertyInfo dynField = (typeof(AzurePSCmdlet)).GetProperty("_dataCollectionProfile", BindingFlags.NonPublic | BindingFlags.Instance);

            dynField.SetValue(cmdlt, new AzurePSDataCollectionProfile(false));
        }
Esempio n. 4
0
        public static void EnableDataCollection(this AzurePSCmdlet cmdlt)
        {
            FieldInfo dynField = (typeof(AzurePSCmdlet)).GetField("_dataCollectionProfile", BindingFlags.NonPublic | BindingFlags.Static);

            dynField.SetValue(cmdlt, new AzurePSDataCollectionProfile(true));
        }