-
Notifications
You must be signed in to change notification settings - Fork 57
Better Powershell script #2
Copy link
Copy link
Open
Description
Use this instead:
Minimal profile: UTF‑8 + Fastfetch with explicit config path
try {
[Console]::InputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$OutputEncoding = [System.Text.UTF8Encoding]::new($false)
chcp 65001 > $null
} catch {}
Function to clear screen and redraw Fastfetch
function global:Clear-Host {
# Use Console.Clear() instead of Clear-Host
[Console]::Clear()
if (Get-Command fastfetch -ErrorAction SilentlyContinue) {
fastfetch -c "$env:USERPROFILE/.config/fastfetch/config.jsonc"
}
}
Set aliases safely
if (-not (Get-Alias clear -ErrorAction SilentlyContinue)) { Set-Alias clear Clear-Host }
if (-not (Get-Alias cls -ErrorAction SilentlyContinue)) { Set-Alias cls Clear-Host }
Initial Fastfetch display
Clear-Host
this will print the art again even after you run clear or cls
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels