Public/Add-IdoItDialog.ps1

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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Function Add-IdoItDialog {
    <#
        .SYNOPSIS
        Add-IdoItDialog

        .DESCRIPTION
        Creates a new value for a dialog+ property

        .PARAMETER Category
        This parameter takes a constant name of a specific category

        .PARAMETER Property
        This is the name of the dialog+ property you want to add the value

        .PARAMETER Value
        This is the new value

        .EXAMPLE
        PS>Add-IdoItDialog -Category 'C__CATG__CPU' -Property 'Manufacturer' -Value 'ARM'

        Adds the Value ARM to the CPU Category in the Property Manufacturer

        .NOTES
        Version
        0.1.0 29.12.2017 CB initial release
    #>

        [CmdletBinding( SupportsShouldProcess = $True)]
        Param (
            [Parameter( Mandatory = $True, Position = 0)]
            [String]$Category,

            [Parameter( Mandatory = $True, Position = 1)]
            [String]$Property,

            [Parameter( Mandatory = $True, Position = 2)]
            [String]$Value
        )

        $Params = @{}
        $Params.Add("category",$Category)
        $Params.Add("property",$Property)
        $Params.Add("value",$Value)

        If ($PSCmdlet.ShouldProcess("Create new dialog entry $Category - $Property with value $Value")) {
            $ResultObj = Invoke-IdoIt -Method "cmdb.dialog.create" -Params $Params

            Return $ResultObj
        }
    }