Skip to content
This repository was archived by the owner on Nov 13, 2022. It is now read-only.

Commit fab8914

Browse files
committed
Add fancy banner to startup
1 parent 262caf4 commit fab8914

File tree

2 files changed

+44
-3
lines changed

2 files changed

+44
-3
lines changed

Microsoft.PowerShell_profile.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ rm alias:curl
2929
rm alias:wget
3030

3131
# Print out a fancy PowerShell Banner :)
32-
if (which figlet -ErrorAction Ignore) {
33-
Write-Host (figlet -f slant "PowerShell $($Host.Version.ToString(2))" | Out-String) -ForegroundColor Cyan
34-
}
32+
Banner.ps1
33+
#if (which figlet -ErrorAction Ignore) {
34+
# Write-Host (figlet -f slant "PowerShell $($Host.Version.ToString(2))" | Out-String) -ForegroundColor Cyan
35+
#}
3536

3637
if (gcm pshazz -ea SilentlyContinue) {
3738
pshazz init 'xpando'

Scripts/Banner.ps1

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
$computer = gwmi Win32_ComputerSystem
2+
$os = gwmi Win32_OperatingSystem
3+
$processor = gwmi Win32_Processor
4+
$display = gwmi Win32_DisplayConfiguration
5+
$uptime = $os.ConvertToDateTime($os.LocalDateTime) - $os.ConvertToDateTime($os.LastBootUpTime)
6+
7+
$info = `
8+
"Computer: ", "$($computer.Model), $($computer.Manufacturer)",
9+
"OS: ", "$($os.Caption) $($os.OSArchitecture)",
10+
"Kernel: ", "$($os.Version)",
11+
"CPU: ", "$($processor.Name)",
12+
"GPU: ", "$($display.DeviceName)",
13+
"Uptime: ", "$($uptime.Days)d $($uptime.Hours)h $($uptime.Minutes)m $($uptime.Seconds)s",
14+
"Memory: ", "$([math]::Truncate($os.FreePhysicalMemory / 1KB)) MB / $([math]::Truncate($computer.TotalPhysicalMemory / 1MB)) MB",
15+
"Shell: ", "PowerShell v$($Host.Version)"
16+
17+
$logo = `
18+
" .:::.. ", "red", "$($info[0])", "gray", "$($info[1])`r`n", "white",
19+
" ccccccccccc. ", "red", "$($info[2])", "gray", "$($info[3])`r`n", "white",
20+
" :ccccccccccc", "red", " :Cc. :c ", "green", "$($info[4])", "gray", "$($info[5])`r`n", "white",
21+
" ccccccccccc.", "red", " ooooooooooo. ", "green", "$($info[6])", "gray", "$($info[7])`r`n", "white",
22+
" :cccccccccc:", "red", " cooooooooooc ", "green", "$($info[8])", "gray", "$($info[9])`r`n", "white",
23+
" .oc::'':cccc", "red", " .ooooooooooo. ", "green", "$($info[10])", "gray", "$($info[11])`r`n", "white",
24+
" .:ccocc.", "blue", " oooooooooooc ", "green", "$($info[12])", "gray", "$($info[13])`r`n", "white",
25+
" :oooooooocoo", "blue", " .coCoCooc. ", "green", "$($info[14])", "gray", "$($info[15])`r`n", "white",
26+
" oooooooooco.", "blue", " COo. ", "yellow", "''", "green", " .cCc `r`n", "yellow",
27+
" :ooooooooooc", "blue", " cOCCCCCCCCCC: `r`n", "yellow",
28+
" ooooooooooo.", "blue", " CCCCCCCCCCO: `r`n", "yellow",
29+
" cc:. .:co:", "blue", " oOCCCCCCCCOo `r`n", "yellow",
30+
" .OCCCCCCCCCO. `r`n", "yellow",
31+
" .coCCCoc. `r`n", "yellow"
32+
33+
clear
34+
for ($i = 0; $i -lt $logo.Length; $i+=2) {
35+
$str = $logo[$i]
36+
$color = $logo[$i+1]
37+
Write-Host $str -f $color -nonewline
38+
}
39+
40+
Write-Host

0 commit comments

Comments
 (0)