modified: RdzeN-Profile.ps1
new file: functions/Find-Notepadpp.ps1 new file: functions/Find-VSCode.ps1
This commit is contained in:
parent
7a95abaf92
commit
40bbb8e19f
@ -51,4 +51,3 @@ Test-Profile
|
||||
Override-Profile
|
||||
# 6. Reload Profile
|
||||
Reload-Profile
|
||||
|
||||
|
26
functions/Find-Notepadpp.ps1
Normal file
26
functions/Find-Notepadpp.ps1
Normal file
@ -0,0 +1,26 @@
|
||||
# gitea.RdzeN.net
|
||||
# Find notepad++
|
||||
# use notepad++ as editor
|
||||
|
||||
function find-notepadpp {
|
||||
$a = Get-ChildItem -Path $env:ProgramFiles -Filter "notepad++.exe" -Recurse -File -ErrorAction SilentlyContinue
|
||||
$b = Get-ChildItem -Path ${env:ProgramFiles(x86)} -Filter "notepad++.exe" -Recurse -File -ErrorAction SilentlyContinue
|
||||
|
||||
if ($a -ne $null) {
|
||||
$notepadpp = $a[0].FullName
|
||||
} else {
|
||||
$notepadpp = $b[0].FullName
|
||||
}
|
||||
if ($notepadpp -ne $null) {
|
||||
return $notepadpp
|
||||
}
|
||||
}
|
||||
$notepadpp = find-notepadpp
|
||||
if ($notepadpp -ne $null) {
|
||||
function editn {
|
||||
param (
|
||||
$filepath
|
||||
)
|
||||
Start-Process $notepadpp -ArgumentList $filepath
|
||||
}
|
||||
}
|
26
functions/Find-VSCode.ps1
Normal file
26
functions/Find-VSCode.ps1
Normal file
@ -0,0 +1,26 @@
|
||||
# gitea.RdzeN.net
|
||||
# Find notepad++
|
||||
# use notepad++ as editor
|
||||
|
||||
function find-vscode {
|
||||
$a = Get-ChildItem -Path $env:ProgramFiles -Filter "Code.exe" -Recurse -File -ErrorAction SilentlyContinue
|
||||
$b = Get-ChildItem -Path ${env:ProgramFiles(x86)} -Filter "Code.exe" -Recurse -File -ErrorAction SilentlyContinue
|
||||
|
||||
if ($a -ne $null) {
|
||||
$vscode = $a[0].FullName
|
||||
} else {
|
||||
$vscode = $b[0].FullName
|
||||
}
|
||||
if ($vscode -ne $null) {
|
||||
return $vscode
|
||||
}
|
||||
}
|
||||
$vscode = find-vscode
|
||||
if ($vscode -ne $null) {
|
||||
function editv {
|
||||
param (
|
||||
$filepath
|
||||
)
|
||||
Start-Process $vscode -ArgumentList $filepath
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user