Powershell How to add a number into a variable
powershell
Solution
force to `[int]` before assign value to $t0 ( `get-date -uformat` returns [string] type ):
[int]$t0 = Get-date -UFormat "%H%M"
$t1 = $t0 + 10
if you change the order the coercing feature of powershell gives the expected value:
$t0 = Get-date -UFormat "%H%M"
$t1 = 10 + $t0
because second operand is cast to type of first one
Problem
how can I add a number to another number contained into a variable? ``` $t0 = Get-date -UFormat "%H%M" $t1 = $t0 + 10 ``` so, if $t0 is 1030, I would $t1 values 1040.