41 lines
926 B
Cheetah
41 lines
926 B
Cheetah
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\atomic.omp.json" | Invoke-Expression
|
|
|
|
function Get-LastN {
|
|
param (
|
|
[Parameter(Position=0)]
|
|
[int]$days = -7
|
|
)
|
|
Get-ChildItem -Path . -Recurse| ? {$_.LastWriteTime -gt (Get-Date).AddDays($days)}
|
|
}
|
|
|
|
# Using positional parameters
|
|
# See https://www.sharepointdiary.com/2021/02/powershell-function-parameters.html
|
|
function Net-Cat() {
|
|
param (
|
|
[Parameter(Position=0)]
|
|
[string]$computerName = "localhost",
|
|
[Parameter(Position=1)]
|
|
[int]$port = 22
|
|
)
|
|
|
|
Test-NetConnection -ComputerName $computerName -Port $port -InformationLevel Detailed
|
|
}
|
|
|
|
# Navigate one directory up
|
|
function Go-One-Level-Up {
|
|
cd ..
|
|
}
|
|
# Navigate two directories up
|
|
function Go-Two-Levels-Up {
|
|
cd ..
|
|
cd ..
|
|
}
|
|
|
|
# Set alias for navigation functions
|
|
Set-Alias .. Go-One-Level-Up
|
|
Set-Alias ... Go-Two-Levels-Up
|
|
|
|
# More Aliases
|
|
Set-Alias vi nvim
|
|
Set-Alias vim nvim
|