udpated powershell profile

This commit is contained in:
Daveanand Mannie
2024-09-07 16:50:11 -04:00
parent 8a814d4423
commit 6f221e7fa0
2 changed files with 32 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
require("config.lazy") require("config.lazy")
-- powershell so my shit compiles with zig when i install -- powershell so my shit compiles with zig when i install
vim.o.shell = "C:/Program Files/PowerShell/7/pwsh.exe" vim.o.shell = "C:/Program Files/PowerShell/7/pwsh.exe"
vim.o.shellcmdflag = "-nologo -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;" -- vim.o.shellcmdflag = "-nologo -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;"
vim.o.shellredir = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode" vim.o.shellredir = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode"
vim.o.shellpipe = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode" vim.o.shellpipe = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode"
vim.o.shellquote = "" vim.o.shellquote = ""

View File

@@ -1,11 +1,35 @@
#### Don't forget to add this to the the profile default location is $PROFILE #### Don't forget to add this to the the profile default location is $PROFILE
Write-Output "Hello Daveanand" function Write-Display-Header
{
param (
[string]$HeaderText = "Hello",
[ConsoleColor]$HeaderTextColor = [ConsoleColor]::Magenta
)
$HeaderText = "💻 Hello Daveanand 💻"
# Get terminal width
$width = $host.UI.RawUI.WindowSize.Width
# Create the header line and padding
$line = "=" * $width
$padding = [math]::Max(0, ($width - $HeaderText.Length) / 2)
# Print the header line with `=` characters
Write-Host $line
# Print the header text centered
Write-Host (" " * $padding) -NoNewline
Write-Host $HeaderText -ForegroundColor $HeaderTextColor -NoNewline
Write-Host (" " * $padding)
# Print the bottom line
Write-Host $line
}
function Show-LoadingWheel function Show-LoadingWheel
{ {
$duration = 1 $duration = 2
# Define spinner characters # Define spinner characters
$spinnerChars = @('|', '/', '-', '\') $spinnerChars = @('|', '/', '', '\')
$delay = 25 # Adjust this value for spinner speed $delay = 25 # Adjust this value for spinner speed
@@ -22,7 +46,7 @@ function Show-LoadingWheel
{ {
# Clear the current line and display the spinner character # Clear the current line and display the spinner character
$host.UI.RawUI.CursorPosition = @{X=0;Y=$host.UI.RawUI.CursorPosition.Y} $host.UI.RawUI.CursorPosition = @{X=0;Y=$host.UI.RawUI.CursorPosition.Y}
Write-Host -NoNewline "$char $char $char $char $char $char" Write-Host -NoNewline "$char $char $char $char $char $char" -ForegroundColor Magenta
# Break the loop if the total elapsed time exceeds the duration # Break the loop if the total elapsed time exceeds the duration
if ((Get-Date) -gt $startTime.AddSeconds($duration)) if ((Get-Date) -gt $startTime.AddSeconds($duration))
@@ -34,9 +58,11 @@ function Show-LoadingWheel
# Clear the spinner character after the loading is done # Clear the spinner character after the loading is done
$host.UI.RawUI.CursorPosition = @{X=0;Y=$host.UI.RawUI.CursorPosition.Y} $host.UI.RawUI.CursorPosition = @{X=0;Y=$host.UI.RawUI.CursorPosition.Y}
Write-Host -NoNewline " " | Out-Null Write-Host " " | Out-Null
} }
######### execution ###############
Show-LoadingWheel | Out-Null Show-LoadingWheel | Out-Null
Write-Display-Header
##################### Aliases ############################# ##################### Aliases #############################