Sunday, December 31, 2017

PowerShell Tambola Number Announcer

Fun with PowerShell

Yesterday, we played Tambola and it was hard to find a free Number Announcer

Here's a small PowerShell script that will announce the Tambola Numbers so that you can play and enjoy!!!!

How to use it?

Step 1: Press Windows Key & R













Step 2: Type in Notepad.exe

Step 3: Copy the code below and Paste it in the Notepad

Write-Host "Welcome to PowerShell Tambola Announcer by Nikhil Sharma!!"
Add-Type -AssemblyName System.speech
$tmp_speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
   
$tmp_speak.Speak("Welcome to PowerShell Tambola Announcer by Nikhil Sharma")
[array]$tmp_nums = get-random -Count 90 -InputObject (1..90)
[array]$tmp_spoken = $null
foreach ($tmp_num in $tmp_nums) {
    $tmp_speak.Speak("The number is $tmp_num")
    Write-host "The number is $tmp_num `n" -ForegroundColor White -BackgroundColor Black       
   
    $tmp_spoken += $tmp_num
    $tmp_spoken = $tmp_spoken | Sort-Object
    Write-Host "All spoken numbers - Sorted" -ForegroundColor Red
    Write-Host $tmp_spoken -Separator " | "
    Pause
    Write-Host "`n"
}
Clear-Variable tmp*

Step 4: Now Click on File in the Menu and Select "save as"





Step 5: Browse to desktop and Save the file as "tambola.ps1". Check the Screenshot below.




Step 6: Now Close the file.

Step 7: Press Windows & R key again.


Step 8: This time type in powershell




Step 9: Drag the Tambola file in the PowerShell and Enjoy!!!


Now, anytime you need a number announcer for your Tambola Game.. Just follow the steps 7 till 9 :)

 


Friday, May 12, 2017

Install PowerShell on ubuntu 17.04


Install PowerShell on Ubuntu 17.04

I see a lot of people struggling to get PowerShell on the new Ubuntu distro



The package manage was unable to install PowerShell due to missing dependent library "libicu55".

Here's the little tweak you can do:

- Download the library from - http://packages.ubuntu.com/en/xenial/amd64/libicu55/download


Once you download the file run the following command to install it

 sudo apt install ./libicu55_55.1-7ubuntu0.2_amd64.deb

Post the library install rerun the PowerShell install command and enjoy 

sudo apt-get install -y powershell