MCPcopy Index your code
hub / github.com/PowerShell/DSC / get_exe_path

Function get_exe_path

lib/dsc-lib/src/util.rs:189–199  ·  view source on GitHub ↗

Gets path to the current dsc process. If dsc is started using a symlink, this functon returns target of the symlink. # Errors Will return `Err` if path to the current exe can't be retrived.

()

Source from the content-addressed store, hash-verified

187///
188/// Will return `Err` if path to the current exe can't be retrived.
189pub fn get_exe_path() -> Result<PathBuf, DscError> {
190 if let Ok(exe) = env::current_exe() {
191 if let Ok(target_path) = fs::read_link(exe.clone()) {
192 return Ok(target_path);
193 }
194
195 return Ok(exe);
196 }
197
198 Err(DscError::NotSupported(t!("util.failedToGetExePath").to_string()))
199}
200
201#[cfg(target_os = "windows")]
202fn get_settings_policy_file_path() -> String

Callers 2

get_settingFunction · 0.85
get_resource_pathsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected