Hi there! I am a VS C# programmer. Now I am learning PowerShell 3.0
During learning, I tried to make a block of codes for identifying input number's type. The code is:
#Starting of block
cls
$a = Read-Host 'Ínput'
if ($a -gt 0) {
Write-Host 'The input is positive'}
elseif ($a -eq 0) {
Write-Host 'The input is zero'}
else {
Write-Host 'The input is negative'}
#Ending of block
Unfortunately, the output is:
-----------------------------------
Ínput: 5
The input is positive
-----------------------------------
Ínput: 0
The input is zero
-----------------------------------
Ínput: -2
The input is positive
PS C:\Users\Admin> $a
-2
-----------------------------------
Ínput: .8
The input is negative
PS C:\Users\Razib> $a
.8
-----------------------------------
I am totally confused! I understand that I am missing some conditional operator's behavior pattern knowledge.
Can someone please help me out about it?
Regards.