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

Method get_value

archive/ntreg/src/registry_key.rs:282–290  ·  view source on GitHub ↗

Gets a value for the current key. # Arguments `name` - A string containing the name of the value. # Examples ``` # use ntreg::registry_key::*; let key = RegistryKey::new(r"HKCU\Environment").unwrap(); let value = key.get_value("Path"); assert!(value.is_ok()); ```

(&self, name: &str)

Source from the content-addressed store, hash-verified

280 /// assert!(value.is_ok());
281 /// ```
282 pub fn get_value(&self, name: &str) -> Result<RegistryValue, NtStatusError> {
283 let mut reg_value = RegistryValue {
284 key_path: self.path.clone(),
285 name: name.to_string(),
286 data: RegistryValueData::None,
287 };
288 reg_value.query()?;
289 Ok(reg_value)
290 }
291
292 /// Creates or sets a value for the current key.
293 ///

Callers 3

config_getFunction · 0.80
config_setFunction · 0.80
test_valueFunction · 0.80

Calls 1

queryMethod · 0.80

Tested by 1

test_valueFunction · 0.64