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

Method new

lib/dsc-lib-registry/src/lib.rs:59–76  ·  view source on GitHub ↗

Create a new `RegistryHelper`. # Arguments `config` - The string with registry configuration information. # Errors `RegistryError` - The error that occurred.

(key_path: &str, value_name: Option<String>, value_data: Option<RegistryValueData>)

Source from the content-addressed store, hash-verified

57 ///
58 /// * `RegistryError` - The error that occurred.
59 pub fn new(key_path: &str, value_name: Option<String>, value_data: Option<RegistryValueData>) -> Result<Self, RegistryError> {
60 let (hive, subkey) = get_hive_from_path(key_path)?;
61 let config = Registry {
62 key_path: key_path.to_string(),
63 value_name,
64 value_data,
65 metadata: None,
66 exist: None,
67 };
68 Ok(
69 Self {
70 config,
71 hive,
72 subkey: subkey.to_string(),
73 what_if: false
74 }
75 )
76 }
77
78 pub fn enable_what_if(&mut self) {
79 self.what_if = true;

Callers

nothing calls this directly

Calls 1

get_hive_from_pathFunction · 0.85

Tested by

no test coverage detected