From 2b90148f240fde30eff75814414c8a273d8d935d Mon Sep 17 00:00:00 2001 From: Jaap Brasser Date: Fri, 20 Sep 2019 10:02:14 +0530 Subject: [PATCH] Renamed times to count --- Write-Emoticon/Write-Emoticon.ps1 | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Write-Emoticon/Write-Emoticon.ps1 b/Write-Emoticon/Write-Emoticon.ps1 index b49c7e2..20ae790 100644 --- a/Write-Emoticon/Write-Emoticon.ps1 +++ b/Write-Emoticon/Write-Emoticon.ps1 @@ -11,17 +11,33 @@ DateUpdated: 2019-09-20 Version: 1.0.0 Blog: https://www.jaapbrasser.com GitHub: https://www.github.com/jaapbrasser + +.EXAMPLE +Write-Emoticon + +Description +----------- + +Will indefinitely output a string of emoticons + +.EXAMPLE +Write-Emoticon -Count 10 + +Description +----------- + +Will output a series of 10 emoticons #> param( - # Number of emoticons showed - [int] $Times, + # Number of emoticons showed, if not specified the function will continue indefinitely + [int] $Count, # Delay in milliseconds, set to 50ms as a default value [int] $Delay = 50 ) - if ($Times) { - 1..$Times | ForEach-Object { + if ($Count) { + 1..$Count | ForEach-Object { Write-Host "$(129408..129431 | Get-Random | ForEach-Object { [char]::convertfromutf32($_)}) " -NoNewLine -ForegroundColor (1..15|Get-Random) Start-Sleep -Milliseconds 50