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

Method new

lib/dsc-lib/src/configure/context.rs:50–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48impl Context {
49 #[must_use]
50 pub fn new() -> Self {
51 Self {
52 copy: HashMap::new(),
53 copy_current_loop_name: String::new(),
54 dsc_version: None,
55 execution_type: ExecutionKind::Actual,
56 extensions: Vec::new(),
57 lambda_raw_args: std::cell::RefCell::new(None),
58 lambda_variables: HashMap::new(),
59 lambdas: std::cell::RefCell::new(HashMap::new()),
60 operation: None,
61 outputs: Map::new(),
62 parameters: HashMap::new(),
63 process_expressions: true,
64 process_mode: ProcessMode::Normal,
65 processing_parameter_defaults: false,
66 references: Map::new(),
67 restart_required: None,
68 security_context: match get_security_context() {
69 SecurityContext::Admin => SecurityContextKind::Elevated,
70 SecurityContext::User => SecurityContextKind::Restricted,
71 },
72 start_datetime: chrono::Local::now(),
73 stdout: None,
74 system_root: get_default_os_system_root(),
75 user_functions: HashMap::new(),
76 variables: Map::new(),
77 }
78 }
79}
80
81impl Default for Context {

Callers

nothing calls this directly

Calls 3

get_security_contextFunction · 0.85
newFunction · 0.50

Tested by

no test coverage detected