dotfiles/.config/powershell/Microsoft.PowerShell_profile.ps1

52 lines
1 KiB
PowerShell
Raw Permalink Normal View History

2024-06-07 16:59:09 -05:00
oh-my-posh init pwsh --config ~/.config/ohmyposh/config.toml | Invoke-Expression
2024-04-01 20:15:11 -05:00
Set-PSReadLineOption -PredictionSource History
@(
2024-06-07 16:59:09 -05:00
"cat,get-content"
"cd,set-location"
"clear,clear-host"
"cp,copy-item"
"history,get-history"
"kill,stop-process"
"ls,Get-ChildItem"
"mv,move-item"
"ps,get-process"
"pwd,get-location"
"which,get-command"
"open,Invoke-Item"
"basename,Split-Path"
"realpath,resolve-path"
2024-04-01 20:15:11 -05:00
) | ForEach-Object {
2024-06-07 16:59:09 -05:00
$Alias = ($PSItem -split ",")[0]
$value = ($PSItem -split ",")[1]
Set-Alias -Name $Alias -Value $value -Option AllScope
2024-04-01 20:15:11 -05:00
}
$env:POWERSHELL_TELEMETRY_OPTOUT = 1
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
2024-05-26 09:05:55 -05:00
$tokens = @(
@{
name = "GITLAB_TOKEN"
value = "cli-gitlab"
}
2024-07-07 09:06:00 -05:00
@{
name = "GITHUB_TOKEN"
value = "cli-github"
}
@{
name = "GITEA_TOKEN"
value = "cli-gitea"
}
2024-05-26 09:05:55 -05:00
)
2024-06-07 16:59:09 -05:00
function unlockbw
{
2024-05-26 09:05:55 -05:00
$env:BW_SESSION = "$(bw unlock --raw)"
2024-06-07 16:59:09 -05:00
foreach ($token in $tokens)
{
2024-05-26 09:05:55 -05:00
Set-Variable -Name $token.name -Value $(bw get password $token.value) -Scope script
}
}