function a() { return 10 } $b = 10 write-Host "b = $b" [int]$b += a write-Host "b = $b" [int]$b = a + 10 write-Host "b = $b" Output for the above script is: b = 10 b = 20 b = 10
I have C programming and recently started programming in PS. I tried to write a simple program that uses the return value from a function in an instruction. I am confused by the results. The following statements work differently.
[int]$b += a [int]$b = a + 10
Can someone explain the reason to me?
Hi
Jugari
source share