Zahlen - Zeichen

Ein paar kleine Beispiele

2+3
2..5

Zahlen einfach implizit zuweisen mit

$i = ...
$i.GetType().Name
$i.GetType().FullName

Rundung

18 / 5
# 3,6
[Int](18/5)
# 4

Type holen

$a = 1
$a.GetType().FullName
# System.Int32
$a = 1.87
$a.GetType().FullName
# System.Double
$a = 623876378232
$a.GetType().FullName
# System.Int64
$a = ‘Hello’
$a.GetType().FullName
# System.String
$a = Get-Date
$a.GetType().FullName
# System.DateTime

Zahlen - Int

[Int32]::MaxValue
# 2147483647
[UInt32]::MaxValue
# 4294967295
[Int32]::MinValue
# -2147483648
[UInt32]::MinValue
# 0

Zeichen - Charakter

[Char]65
# A
[Byte][Char]’A’
# 65
[Byte[]][Char[]]’Hello’
# 72
#101
#108
#108
#111

[Char[]](65..90)
[Char[]]'Hello'
[Byte[]][Char[]]'Hello'