< Back

New-AzureRmIotHub

Tue Jan 29, 2019 9:49 pm

NAME New-AzureRmIotHub



SYNOPSIS

Creates a new IotHub.





SYNTAX

New-AzureRmIotHub [-DefaultProfile <IAzureContextContainer>] -Location <String> -Name <String> [-Properties <PSIotHubInputProperties>]

-ResourceGroupName <String> -SkuName {F1 | S1 | S2 | S3} -Units <Int64> [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

Creates a new IotHub. You can create the IotHub with either the default properties or specify the input proerties.





PARAMETERS

-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Location <String>

Location where the IoT hub needs to be created.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Name of the IotHub



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Properties <PSIotHubInputProperties>

Properties of the IoT hub.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ResourceGroupName <String>

Resource Group Name



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SkuName <PSIotHubSku>

Name of the sku



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Units <Int64>

Number of units



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String

Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHubSku System.Int64

Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHubInputProperties





OUTPUTS

Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHub







NOTES









Example 1 Create a new IotHub with default properties



PS C:\\> New-AzureRmIotHub -ResourceGroupName "myresourcegroup" -Name "myiothub" -SkuName "S1" -Units 1 -Location "northeurope"



Creates a new IotHub named "myiothub" of the sku "S1", capacity 1 and location "northeurope".





Example 2 Create a new IotHub with the MaxDeliveryCount of the CloudtoDevice Queue set to 20



PS C:\\> New-AzureRmIotHub -ResourceGroupName "myresourcegroup" -Name "myiothub" -SkuName "S1" -Units 1 -Location "northeurope" -Properties

$properties



Creates a new IotHub named "myiothub" of the sku "S1", capacity 1 and location "northeurope" with advanced input properties represented by

$properties.



$psCloudToDeviceProperties = New-Object Microsoft.Azure.Commands.Management.IotHub.Models.PSCloudToDeviceProperties -Property

@{MaxDeliveryCount=20} $properties = New-Object Microsoft.Azure.Commands.Management.IotHub.Models.PSIotHubInputProperties -Property

@{CloudToDevice=$psCloudToDeviceProperties} New-AzureRmIotHub -ResourceGroupName "myresourcegroup" -Name "myiothub" -SkuName "S1" -Units 1

-Location "northeurope" -Properties $properties







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... rermiothub