MCPcopy Create free account
hub / github.com/PowerShell/DSC / delete

Method delete

lib/dsc-lib/src/dscresources/dscresource.rs:488–505  ·  view source on GitHub ↗
(&self, filter: &str, execution_type: &ExecutionKind)

Source from the content-addressed store, hash-verified

486 }
487
488 fn delete(&self, filter: &str, execution_type: &ExecutionKind) -> Result<DeleteResultKind, DscError> {
489 debug!("{}", t!("dscresources.dscresource.invokeDelete", resource = self.type_name));
490 if let Some(deprecation_message) = self.deprecation_message.as_ref() {
491 warn!("{}", t!("dscresources.dscresource.deprecationMessage", resource = self.type_name, message = deprecation_message));
492 }
493 if let Some(adapter) = &self.require_adapter {
494 return self.invoke_delete_with_adapter(adapter, self, filter, execution_type);
495 }
496
497 match &self.implemented_as {
498 Some(ImplementedAs::Command) => {
499 command_resource::invoke_delete(self, filter, self.target_resource.as_deref(), execution_type)
500 },
501 _ => {
502 Err(DscError::NotImplemented(t!("dscresources.dscresource.customResourceNotSupported").to_string()))
503 },
504 }
505 }
506
507 fn validate(&self, config: &str) -> Result<ValidateResult, DscError> {
508 debug!("{}", t!("dscresources.dscresource.invokeValidate", resource = self.type_name));

Callers 3

invoke_setMethod · 0.45
removeMethod · 0.45

Calls 3

invoke_deleteFunction · 0.85
as_refMethod · 0.45

Tested by

no test coverage detected