internal/functions/Set-PackageUpdateSetting/ConvertTo-PackageUpdateSetting.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
function ConvertTo-PackageUpdateSetting {
    <#
    .SYNOPSIS
        ConvertFrom-PackageUpdateSetting
 
    .DESCRIPTION
        Convert from a PackageUpdateSetting object to a PSCustomObject
 
    .PARAMETER InputObject
        PSCustomObject object to convert
 
    .EXAMPLE
        PS C:\> Get-PackageUpdateSetting | ConvertFrom-PackageUpdateSetting | ConvertTo-PackageUpdateSetting
 
        Check if URI is a URI that can be covered for plain text release notes
    #>

    [CmdletBinding()]
    [OutputType([PackageUpdate.Configuration])]
    param (
        [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = "SetBehaviour")]
        [PSCustomObject]
        $InputObject
    )

    begin {
    }

    process {
        $hash = [ordered]@{ }

        foreach ($property in $InputObject.psobject.Properties) {
            $hash[$property.Name] = $property.Value
        }

        [PackageUpdate.Configuration]$hash
    }

    end {
    }
}