What is the complete list of number suffixes in PowerShell?

What is the complete list of suffixes you can use for PowerShell literary numbers?
So far I have found:

╔════════╦═════════╦════════════════════════╗ β•‘ Suffix β•‘ Example β•‘ Result β•‘ ╠════════╬═════════╬════════════════════════╣ β•‘ L β•‘ 1L β•‘ Type = Int64 β•‘ β•‘ D β•‘ 1D β•‘ Type = Decimal β•‘ β•‘ KB β•‘ 1KB β•‘ 1KB = 1024 β•‘ β•‘ MB β•‘ 1MB β•‘ 1MB = 1048576 β•‘ β•‘ GB β•‘ 1GB β•‘ 1GB = 1073741824 β•‘ β•‘ TB β•‘ 1TB β•‘ 1TB = 1099511627776 β•‘ β•‘ PB β•‘ 1PB β•‘ 1PB = 1125899906842624 β•‘ β•šβ•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• 

But I can’t find a source that lists all of them.

+8
source share
2 answers

According to the PowerShell Language Specification (V3) , which is a complete set.

  • Β§2.3.5.1.1 Integer letters include: l , kb , mb , gb , tb and pb .
  • Β§2.3.5.1.2 These literals add d .

As far as I know (an update to the specification has not been published) PowerShell V4 does not add any additional suffixes.

+8
source

Enough here is fully documented .

 y signed byte data type Added in PowerShell 6.2 uy unsigned byte data type Added in PowerShell 6.2 s short data type Added in PowerShell 6.2 us unsigned short data type Added in PowerShell 6.2 l long data type u unsigned int or long data type Added in PowerShell 6.2 ul unsigned long data type Added in PowerShell 6.2 kb kilobyte multiplier mb megabyte multiplier gb gigabyte multiplier tb terabyte multiplier pb petabyte multiplier 
+1
source

Source: https://habr.com/ru/post/971481/


All Articles