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

Method get_resource_path_setting

lib/dsc-lib/src/discovery/command_discovery.rs:97–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95 pub fn get_extensions(&self) -> DiscoveryExtensionCache { locked_clone!(EXTENSIONS) }
96
97 fn get_resource_path_setting() -> Result<ResourcePathSetting, DscError>
98 {
99 if let Ok(v) = get_setting("resourcePath") {
100 // if there is a policy value defined - use it; otherwise use setting value
101 if v.policy != serde_json::Value::Null {
102 match serde_json::from_value::<ResourcePathSetting>(v.policy) {
103 Ok(v) => {
104 return Ok(v);
105 },
106 Err(e) => { return Err(DscError::Setting(format!("{e}"))); }
107 }
108 } else if v.setting != serde_json::Value::Null {
109 match serde_json::from_value::<ResourcePathSetting>(v.setting) {
110 Ok(v) => {
111 return Ok(v);
112 },
113 Err(e) => { return Err(DscError::Setting(format!("{e}"))); }
114 }
115 }
116 }
117
118 Err(DscError::Setting(t!("discovery.commandDiscovery.couldNotReadSetting").to_string()))
119 }
120
121 fn get_resource_paths() -> Result<Vec<PathBuf>, DscError>
122 {

Callers

nothing calls this directly

Calls 2

get_settingFunction · 0.85
SettingEnum · 0.85

Tested by

no test coverage detected