modified: RdzeN-Profile.ps1
modified: functions/Find-Notepadpp.ps1 modified: functions/Find-VSCode.ps1 new file: functions/Open-Folder.ps1
This commit is contained in:
parent
b3275adee3
commit
f31a592d00
@ -103,11 +103,27 @@ if ($functions_to_pull.Count -gt 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# 4. List functions
|
# 4. List functions
|
||||||
$functions = Get-ChildItem $path_gitea_powershell_profile_functions | Sort-Object
|
# Lokalizacja plików
|
||||||
for ($i = 0; $i -lt $functions.Count; $i++) {
|
$path_to_search = "$path_gitea_powershell_profile_functions\*"
|
||||||
|
|
||||||
|
# Zmienna do przechowywania wyników
|
||||||
|
$found_functions = @()
|
||||||
|
|
||||||
|
# Szukanie funkcji w plikach
|
||||||
|
Get-ChildItem $path_to_search | ForEach-Object {
|
||||||
|
$file_content = Get-Content $_.FullName -Raw
|
||||||
|
$matches = [Regex]::Matches($file_content, '(?<=function\s).*?(?={)')
|
||||||
|
foreach ($match in $matches) {
|
||||||
|
$found_functions += $match.Value.Trim()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$found_functions = $found_functions | Sort-Object
|
||||||
|
|
||||||
|
for ($i = 0; $i -lt $found_functions.Count; $i++) {
|
||||||
Write-Host "$($i+1)" -NoNewline -ForegroundColor Cyan
|
Write-Host "$($i+1)" -NoNewline -ForegroundColor Cyan
|
||||||
Write-Host ")`t" -NoNewline -ForegroundColor Blue
|
Write-Host ")`t" -NoNewline -ForegroundColor Blue
|
||||||
Write-Host "$(($functions[$i].Name).Replace('.ps1',''))" -ForegroundColor Cyan
|
Write-Host "$($found_functions[$i])" -ForegroundColor Cyan
|
||||||
}
|
}
|
||||||
|
|
||||||
# 99. Prompt profile loaded
|
# 99. Prompt profile loaded
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# Find notepad++
|
# Find notepad++
|
||||||
# use notepad++ as editor
|
# use notepad++ as editor
|
||||||
|
|
||||||
function find-notepadpp {
|
function Find-Notepadpp {
|
||||||
$a = Get-ChildItem -Path $env:ProgramFiles -Filter "notepad++.exe" -Recurse -File -ErrorAction SilentlyContinue
|
$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
|
$b = Get-ChildItem -Path ${env:ProgramFiles(x86)} -Filter "notepad++.exe" -Recurse -File -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
@ -15,9 +15,9 @@ function find-notepadpp {
|
|||||||
return $notepadpp
|
return $notepadpp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$notepadpp = find-notepadpp
|
$notepadpp = Find-Notepadpp
|
||||||
if ($notepadpp -ne $null) {
|
if ($notepadpp -ne $null) {
|
||||||
function editn {
|
function EditN {
|
||||||
param (
|
param (
|
||||||
$filepath
|
$filepath
|
||||||
)
|
)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# Find notepad++
|
# Find notepad++
|
||||||
# use notepad++ as editor
|
# use notepad++ as editor
|
||||||
|
|
||||||
function find-vscode {
|
function Find-Vscode {
|
||||||
$a = Get-ChildItem -Path $env:ProgramFiles -Filter "Code.exe" -Recurse -File -ErrorAction SilentlyContinue
|
$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
|
$b = Get-ChildItem -Path ${env:ProgramFiles(x86)} -Filter "Code.exe" -Recurse -File -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
@ -15,9 +15,9 @@ function find-vscode {
|
|||||||
return $vscode
|
return $vscode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$vscode = find-vscode
|
$vscode = Find-Vscode
|
||||||
if ($vscode -ne $null) {
|
if ($vscode -ne $null) {
|
||||||
function editv {
|
function EditV {
|
||||||
param (
|
param (
|
||||||
$filepath
|
$filepath
|
||||||
)
|
)
|
||||||
|
6
functions/Open-Folder.ps1
Normal file
6
functions/Open-Folder.ps1
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# gitea.RdzeN.net
|
||||||
|
# Open Folder in Explorer
|
||||||
|
function Open-Folder {
|
||||||
|
param ([string]$path = $PWD)
|
||||||
|
Start-Process Explorer -ArgumentList $path
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user