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:
Roey Darwish Dror
2020-11-19 13:32:21 +02:00
parent 9a368d8218
commit dad0a9b1bb

View File

@@ -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())