PowerShell-Profile/functions/Find-Notepadpp.ps1
Tomasz Kostrzewa 40bbb8e19f modified: RdzeN-Profile.ps1
new file:   functions/Find-Notepadpp.ps1
	new file:   functions/Find-VSCode.ps1
2024-03-05 21:34:21 +01:00

26 lines
698 B
PowerShell

# 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
}
}