From 140cbb443b9de4bee62ffcca7f283134668c1000 Mon Sep 17 00:00:00 2001 From: Jaap Brasser Date: Fri, 20 Sep 2019 09:24:59 +0530 Subject: [PATCH] Tested and verified working --- Write-Emoticon/Write-Emoticon.ps1 | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Write-Emoticon/Write-Emoticon.ps1 b/Write-Emoticon/Write-Emoticon.ps1 index 076f83d..4cd4bb9 100644 --- a/Write-Emoticon/Write-Emoticon.ps1 +++ b/Write-Emoticon/Write-Emoticon.ps1 @@ -1,6 +1,21 @@ function Write-Emoticon { param( - $NumberOfEmoticons - ) -} -while(1){Write-Host "$(129408..129431|get-Random|%{[char]::convertfromutf32($_)}) " -NoNewLine -ForegroundColor (1..15|Get-Random);start-sleep -Milliseconds 50} + [int] $Times + ) + + if ($Times) { + 1..$Times | ForEach-Object { + Write-Host "$(129408..129431 | Get-Random | ForEach-Object { + [char]::convertfromutf32($_)}) " -NoNewLine -ForegroundColor (1..15|Get-Random) + Start-Sleep -Milliseconds 50 + } + } else { + # Keep on going forever + while(1) { + Write-Host "$(129408..129431 | Get-Random | ForEach-Object { + [char]::convertfromutf32($_)}) " -NoNewLine -ForegroundColor (1..15|Get-Random) + Start-Sleep -Milliseconds 50 + + } + } +} \ No newline at end of file