Check if the powershell profile directory exists
This works whether the user uses profile.ps1 or Microsoft.PowerShell_profile.ps1
This commit is contained in:
@@ -21,7 +21,7 @@ impl Powershell {
|
||||
|
||||
let profile = path.as_ref().and_then(|path| {
|
||||
Command::new(path)
|
||||
.args(&["-Command", "echo $profile"])
|
||||
.args(&["-Command", "Split-Path $profile"])
|
||||
.check_output()
|
||||
.map(|output| PathBuf::from(output.trim()))
|
||||
.and_then(|p| p.require())
|
||||
|
||||
Reference in New Issue
Block a user