<#############################################################################
The DoPx module provides a rich set of commands that extend the automation
capabilities of the DigitalOcean (DO) cloud service. These commands make it
easier to manage your DigitalOcean environment from Windows PowerShell. When
used with the LinuxPx module, you can manage your entire DigitalOcean
environment from one shell.

Copyright 2014 Kirk Munro

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#############################################################################>

# The id for the base image that will be used when creating the droplet. This may be a numeric id or a slug. Some images may not be available in all regions.[Parameter(Position=1,Mandatory=$true,ValueFromPipelineByPropertyName=$true)][ValidateNotNullOrEmpty()][System.String]$ImageId,

# The id for the size configuration that will be used when creating the droplet. Consult your region settings to see which size configurations are supported.[Parameter(Position=2,Mandatory=$true,ValueFromPipelineByPropertyName=$true)][ValidateNotNullOrEmpty()][System.String]$SizeId,

# The id for the region that you wish to deploy in. You can only deploy droplets in regions that are marked as available.[Parameter(Position=3,Mandatory=$true,ValueFromPipelineByPropertyName=$true)][ValidateNotNullOrEmpty()][System.String]$RegionId,

# A collection of SSH key IDs or fingerprints that you want embedded in the Droplet's root environment upon creation.[Parameter(ValueFromPipelineByPropertyName=$true)][System.String[]]$SshKeys=@(),

# Enables automatic backup on the droplet upon creation. By default, automatic backup is disabled. This can only be enabled when a droplet is created.[Parameter(ValueFromPipelineByPropertyName=$true)][System.Management.Automation.SwitchParameter]$EnableAutomaticBackup=$false,

# Enables IPv6 on the droplet upon creation. By default, IPv6 is disabled. IPv6 is not available in all regions.[Parameter(ValueFromPipelineByPropertyName=$true)][System.Management.Automation.SwitchParameter]$EnableIPv6=$false,

# Enables private networking on the droplet upon creation. By default, private networking is disabled. Private networking is not available in all regions.[Parameter(ValueFromPipelineByPropertyName=$true)][System.Management.Automation.SwitchParameter]$EnablePrivateNetworking=$false,

# User data that you wish to add to the droplet. User data is not supported in all regions. To see if a region supports user data, check whether or not it supports the "metadata" feature.[Parameter(ValueFromPipelineByPropertyName=$true)][System.String]$UserData=$null,

# The access token for your DigitalOcean environment, in secure string format.[Parameter()][ValidateNotNull()][System.Security.SecureString]$AccessToken)process{try{#region Remove any parameters that will not be passed through.

foreach($itemin$Name){Invoke-Snippet-NameProxyFunction.Begin-Parameters@{CommandName='New-DoPxObject'CommandType='Function'PreProcessScriptBlock={#region Identify the endpoint that is used when creating a droplet.

$PSCmdlet.MyInvocation.BoundParameters['RelativeUri']='droplets'

#endregion

#region Identify the properties that will be assigned to the new droplet.