Advertisement
Guest User

Happy Birthday, now with cake!

a guest
May 7th, 2021
574
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.27 KB | None | 0 0
  1.  
  2.  
  3. #Expand PS Window for some goodies
  4.  
  5. $pshost = get-host
  6. $pswindow = $pshost.ui.rawui
  7. $newsize = $pswindow.buffersize
  8. $newsize.height = 3000
  9. $newsize.width = 150
  10. $pswindow.buffersize = $newsize
  11. $newsize = $pswindow.windowsize
  12. $newsize.height = 50
  13. $newsize.width = 150
  14. $pswindow.windowsize = $newsize
  15.  
  16. # Make PowerShell Pretty!
  17. $host.UI.RawUI.ForegroundColor = "DarkGreen"
  18. $host.UI.RawUI.BackgroundColor = "Black"
  19.  
  20. $pswwidth = (get-host).UI.RawUI.MaxWindowSize.Width
  21. function Centralize()
  22. {
  23. param(
  24. [Parameter(Position=0,Mandatory=$true)]
  25. [string]$S
  26. )
  27. $sLength = $S.Length
  28. $padamt = "{0:N0}" -f (($pswwidth-$sLength)/2)
  29. $PadNum = $padamt/1 + $sLength
  30. $CS = $S.PadLeft($PadNum," ").PadRight($PadNum," ") #Padding
  31. Write-Host $CS
  32. }
  33.  
  34. function CakeTime # Written using ASCII Art :D
  35. {
  36. clear
  37. Centralize(" * * ")
  38. Centralize(" * ")
  39. Centralize(" * ")
  40. Centralize(" * ")
  41. Centralize(" * ")
  42. Centralize(" * ")
  43. Centralize(" * ")
  44. Centralize(" * ")
  45. Centralize(" * * ")
  46. Centralize(" * ")
  47. Centralize(" * * ")
  48. Centralize(" * ")
  49. Centralize(" ( ) ")
  50. Centralize(" ) (*) (*) ( ")
  51. Centralize(" * (*) | | (*) ")
  52. Centralize(" | |~| |~| | * ")
  53. Centralize(" |~| | | | | |~| ")
  54. Centralize(" | | | | | | | | ")
  55. Centralize(" ,| |a@@@@| |@@@@@@@@@@@| |@@@@a| |. ")
  56. Centralize(" .,a@@@| |@@@@@| |@@@@@@@@@@@| |@@@@@| |@@@@a,. ")
  57. Centralize(" ,a@@@@@@| |@@@@@@@@@@@@.@@@@@@@@@@@@@@| |@@@@@@@a, ")
  58. Centralize(" a@@@@@@@@@@@@@@@@@@@@@' . `@@@@@@@@@@@@@@@@@@@@@@@@a ")
  59. Centralize(" ;`@@@@@@@@@@@@@@@@@@' . `@@@@@@@@@@@@@@@@@@@@@'; ")
  60. Centralize(" ;@@@`@@@@@@@@@@@@@' . `@@@@@@@@@@@@@@@@'@@@; ")
  61. Centralize(" ;@@@;,.aaaaaaaaaa . aaaaa,,aaaaaaa,;@@@; ")
  62. Centralize(" ;;@;;;;@@@@@@@@;@ @.@ ;@@@;;;@@@@@@;;;;@@; ")
  63. Centralize(" ;;;;;;;@@@@;@@;;@ @@ . @@ ;;@;;;;@@;@@@;;;;;;; ")
  64. Centralize(" ;;;;;;;;@@;;;;;;; @@ . @@ ;;;;;;;;;;;@@;;;;@;; ")
  65. Centralize(" ;;;;;;;;;;;;;;;;;@@ . @@;;;;;;;;;;;;;;;;@@@; ")
  66. Centralize(" ,%%%;;;;;;;;@;;;;;;;; . ;;;;;;;;;;;;;;;;@@;;%%%, ")
  67. Centralize(" .%%%%%%;;;;;;;@@;;;;;;;; ,%%%, ;;;;;;;;;;;;;;;;;;;;%%%%%%, ")
  68. Centralize(".%%%%%%%;;;;;;;@@;;;;;;;; ,%%%%%%%, ;;;;;;;;;;;;;;;;;;;;%%%%%%%,")
  69. Centralize("%%%%%%%%`;;;;;;;;;;;;;;;; %%%%%%%%%%% ;;;;;;;;;;;;;;;;;;;'%%%%%%%%")
  70. Centralize("%%%%%%%%%%%%`;;;;;;;;;;;;,%%%%%%%%%%%%%,;;;;;;;;;;;;;;;'%%%%%%%%%%%%")
  71. Centralize("`%%%%%%%%%%%%%%%%%,,,,,,,%%%%%%%%%%%%%%%,,,,,,,%%%%%%%%%%%%%%%%%%%%'")
  72. Centralize(" `%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%' ")
  73. Centralize(" `%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%' ")
  74. Centralize(" --------------`,,,,,,,,,'------------------ ")
  75. Centralize(" `%%%%%%%' ")
  76. Centralize(" `%%%%%' ")
  77. Centralize(" %%% ")
  78. Centralize(" %%%%% ")
  79. Centralize(" .,%%%%%%%,. ")
  80. Centralize(" ,%%%%%%%%%%%%%%%%%%%, ")
  81. Centralize(" ")
  82. Centralize(" ")
  83. Centralize("Happy Birthday!")
  84. }
  85.  
  86. function Beeper # Happy Birthday song with Beep tones in Powershell Script - Credit to u/hackoofr in r/Powershell for the main beep code.
  87. {
  88. #cls
  89. $BeepList = @(
  90. @{ Pitch = 37; Length = 300; };
  91. @{ Pitch = 1059.274; Length = 300; };
  92. @{ Pitch = 1059.274; Length = 200; };
  93. @{ Pitch = 1188.995; Length = 500; };
  94. @{ Pitch = 1059.274; Length = 500; };
  95. @{ Pitch = 1413.961; Length = 500; };
  96. @{ Pitch = 1334.601; Length = 1000; };
  97.  
  98. @{ Pitch = 1059.274; Length = 300; };
  99. @{ Pitch = 1059.274; Length = 200; };
  100. @{ Pitch = 1188.995; Length = 500; };
  101. @{ Pitch = 1059.274; Length = 500; };
  102. @{ Pitch = 1587.117; Length = 500; };
  103. @{ Pitch = 1413.961; Length = 1000; };
  104.  
  105. @{ Pitch = 1059.274; Length = 300; };
  106. @{ Pitch = 1059.274; Length = 200; };
  107. @{ Pitch = 2118.547; Length = 500; };
  108. @{ Pitch = 1781.479; Length = 500; };
  109. @{ Pitch = 1413.961; Length = 500; };
  110. @{ Pitch = 1334.601; Length = 500; };
  111. @{ Pitch = 1188.995; Length = 800; };
  112. @{ Pitch = 1887.411; Length = 300; };
  113. @{ Pitch = 1887.411; Length = 200; };
  114. @{ Pitch = 1781.479; Length = 500; };
  115. @{ Pitch = 1413.961; Length = 500; };
  116. @{ Pitch = 1587.117; Length = 500; };
  117. @{ Pitch = 1413.961; Length = 900; };
  118. );
  119. # I Just added this For..loop in order to listen the beep tones twice (-_°)
  120. For ($i=1; $i -le 2; $i++) {
  121. foreach ($Beep in $BeepList) {
  122. [System.Console]::Beep($Beep['Pitch'], $Beep['Length']);
  123. }
  124. }
  125. }
  126.  
  127. caketime
  128. beeper
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement