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

Function invoke_get

resources/sshdconfig/src/get.rs:32–48  ·  view source on GitHub ↗

Invoke the get command. # Errors This function will return an error if the desired settings cannot be retrieved.

(input: Option<&String>, setting: &Setting)

Source from the content-addressed store, hash-verified

30///
31/// This function will return an error if the desired settings cannot be retrieved.
32pub fn invoke_get(input: Option<&String>, setting: &Setting) -> Result<Map<String, Value>, SshdConfigError> {
33 debug!("{} {:?}", t!("get.debugSetting").to_string(), setting);
34 trace!("{} {:?}", t!("get.traceInput").to_string(), input);
35 match *setting {
36 Setting::SshdConfig => {
37 let cmd_info = build_command_info(input, true)?;
38 get_sshd_settings(&cmd_info, true)
39 },
40 Setting::WindowsGlobal => {
41 get_default_shell()?;
42 Ok(Map::new())
43 },
44 _ => {
45 Err(SshdConfigError::InvalidInput(t!("get.invalidSetting", setting = format!("{:?}", setting)).to_string()))
46 }
47 }
48}
49
50#[cfg(windows)]
51fn get_default_shell() -> Result<(), SshdConfigError> {

Callers 1

mainFunction · 0.70

Calls 4

build_command_infoFunction · 0.85
get_sshd_settingsFunction · 0.85
get_default_shellFunction · 0.85
newFunction · 0.50

Tested by

no test coverage detected