samples/int32-types.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
[
    {
        "MemberType": "ScriptProperty",
        "MemberName": "SquareRoot",
        "Value": " [math]::Sqrt($this)",
        "TypeName": "System.Int32"
    },
    {
        "MemberType": "ScriptProperty",
        "MemberName": "Squared",
        "Value": " $this*$this",
        "TypeName": "System.Int32"
    },
    {
        "MemberType": "ScriptProperty",
        "MemberName": "Cubed",
        "Value": " [math]::Pow($this,3)",
        "TypeName": "System.Int32"
    },
    {
        "MemberType": "ScriptProperty",
        "MemberName": "Value",
        "Value": " $this",
        "TypeName": "System.Int32"
    },
    {
        "MemberType": "ScriptMethod",
        "MemberName": "GetPercent",
        "Value": "Param([int32]$Total,[int32]$Round=2) [math]::Round(($this/$total)*100,$round)",
        "TypeName": "System.Int32"
    }
]