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

Method invoke

lib/dsc-lib/src/functions/envvar.rs:29–35  ·  view source on GitHub ↗
(&self, args: &[Value], _context: &Context)

Source from the content-addressed store, hash-verified

27 }
28
29 fn invoke(&self, args: &[Value], _context: &Context) -> Result<Value, DscError> {
30 if let Ok(val) = env::var(args[0].as_str().unwrap_or_default()) {
31 return Ok(Value::String(val));
32 }
33
34 Err(DscError::Function("envvar".to_string(), t!("functions.envvar.notFound").to_string()))
35 }
36}
37
38#[cfg(test)]

Callers

nothing calls this directly

Calls 2

as_strMethod · 0.80
FunctionInterface · 0.70

Tested by

no test coverage detected