Public/Resource Property Types/Add-VSElasticLoadBalancingLoadBalancerPolicies.ps1
function Add-VSElasticLoadBalancingLoadBalancerPolicies { <# .SYNOPSIS Adds an AWS::ElasticLoadBalancing::LoadBalancer.Policies resource property to the template .DESCRIPTION Adds an AWS::ElasticLoadBalancing::LoadBalancer.Policies resource property to the template .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-policy.html .PARAMETER Attributes Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-policy.html#cfn-ec2-elb-policy-attributes DuplicatesAllowed: False PrimitiveItemType: Json Required: True Type: List UpdateType: Mutable .PARAMETER InstancePorts Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-policy.html#cfn-ec2-elb-policy-instanceports DuplicatesAllowed: False PrimitiveItemType: String Required: False Type: List UpdateType: Mutable .PARAMETER LoadBalancerPorts Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-policy.html#cfn-ec2-elb-policy-loadbalancerports DuplicatesAllowed: False PrimitiveItemType: String Required: False Type: List UpdateType: Mutable .PARAMETER PolicyName Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-policy.html#cfn-ec2-elb-policy-policyname PrimitiveType: String Required: True UpdateType: Mutable .PARAMETER PolicyType Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-policy.html#cfn-ec2-elb-policy-policytype PrimitiveType: String Required: True UpdateType: Mutable .FUNCTIONALITY Vaporshell #> [OutputType('Vaporshell.Resource.ElasticLoadBalancing.LoadBalancer.Policies')] [cmdletbinding()] Param ( [parameter(Mandatory = $true)] $Attributes, [parameter(Mandatory = $false)] $InstancePorts, [parameter(Mandatory = $false)] $LoadBalancerPorts, [parameter(Mandatory = $true)] [ValidateScript( { $allowedTypes = "System.String","Vaporshell.Function" if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") { $true } else { throw "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")." } })] $PolicyName, [parameter(Mandatory = $true)] [ValidateScript( { $allowedTypes = "System.String","Vaporshell.Function" if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") { $true } else { throw "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")." } })] $PolicyType ) Begin { $obj = [PSCustomObject]@{} } Process { foreach ($psParamKey in $PSBoundParameters.Keys) { $val = $((Get-Variable $psParamKey).Value) if ($val -eq "True") { $val = "true" } elseif ($val -eq "False") { $val = "false" } $obj | Add-Member -MemberType NoteProperty -Name $psParamKey -Value $val } } End { $obj | Add-ObjectDetail -TypeName 'Vaporshell.Resource.ElasticLoadBalancing.LoadBalancer.Policies' } } |