New-​Azure​Rm​Automation​Certificate

Creates an Automation certificate.

Syntax

New-AzureRmAutomationCertificate
   [-ResourceGroupName] <String>
   [-AutomationAccountName] <String>
   [-Name] <String>
   [-Path] <String>
   [-Description <String>]
   [-Exportable]
   [-Password <SecureString>]
   [<CommonParameters>]

Description

The New-AzureRmAutomationCertificate cmdlet creates a certificate in Azure Automation. Provide the path to a certificate file to upload.

Examples

Example 1: Create a new certificate

PS C:\>$Password = ConvertTo-SecureString -String "Password" -AsPlainText -Force
PS C:\> New-AzureRmAutomationCertificate -AutomationAccountName "Contoso17" -Name "ContosoCertificate" -Path "./cert.pfx" -Password $Password -ResourceGroupName "ResourceGroup01"

The first command converts a plain text password to be a secure string by using the ConvertTo-SecureString cmdlet. The command stores that object in the $Password variable.

The second command creates a certificate named ContosoCertificate. The command uses the password stored in $Password. The command specifies the account name and the path of the file that it uploads.

Required Parameters

-AutomationAccountName

Specifies the name of the Automation account for which this cmdlet stores the certificate.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name

Specifies the name for the certificate.

Type:String
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Path

Specifies the path to a script file that this cmdlet uploads. The file can be a .cer or a .pfx file.

Type:String
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of the resource group for which this cmdlet creates a certificate.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-Description

Specifies a description for the certificate.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Exportable

Specifies whether the certificate can be exported.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Password

Specifies the password for the certificate file.

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Outputs

Microsoft.Azure.Commands.Automation.Model.CertificateInfo