PowerShell-Profile/functions/Find-VSCode.ps1
Tomasz Kostrzewa f31a592d00 modified: RdzeN-Profile.ps1
modified:   functions/Find-Notepadpp.ps1
	modified:   functions/Find-VSCode.ps1
	new file:   functions/Open-Folder.ps1
2024-03-06 00:25:22 +01:00

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