26 lines
661 B
PowerShell
26 lines
661 B
PowerShell
# 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
|
|
}
|
|
} |