public override void ExecuteCmdlet() { WebsitesClient = WebsitesClient ?? new WebsitesClient(CurrentSubscription, WriteDebug); switch (Type) { case WebsiteDiagnosticType.Site: WebsitesClient.DisableSiteDiagnostic( Name, WebServerLogging, DetailedErrorMessages, FailedRequestTracing); break; case WebsiteDiagnosticType.Application: WebsitesClient.DisableApplicationDiagnostic(Name, Output); break; default: throw new PSArgumentException(); } if (PassThru.IsPresent) { WriteObject(true); } }