How can I convert a double to an int but make sure it rounds up regardless of the decimal value (as long as decimal value is not 0)?
You can use the .NET [Math]::Ceiling
function and cast the result to [int]
:
PS > [int][Math]::Ceiling(1.1)
2
PS > [int][Math]::Ceiling(1.6)
2
PS >