Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
New-AzAutomationModule
- Module:
- Az.Automation Module
Imports a module into Automation.
Syntax
Default (Default)
New-AzAutomationModule
[-Name] <String>
[-ContentLinkUri] <Uri>
[-RuntimeVersion <String>]
[-ResourceGroupName] <String>
[-AutomationAccountName] <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The New-AzAutomationModule cmdlet imports a module into Azure Automation. This command accepts a compressed file that has a .zip file name extension. The file contains a folder that includes a file that is one of the following types:
- Windows PowerShell module, which has a .psm1 or .dll file name extension
- Windows PowerShell module manifest, which has a .psd1 file name extension
The name of the .zip file, the name of the folder, and the name of the file in the folder must be the same.
Specify the .zip file as a URL that the Automation service can access.
If you import a Windows PowerShell module into Automation by using this cmdlet or the Set-AzAutomationModule cmdlet, the operation is asynchronous.
The command finishes whether the import succeeds or fails.
To check whether it succeeded, run the following command:
PS C:\\\> $ModuleInstance = Get-AzAutomationModule -NameModuleName Check the ProvisioningState property for a value of Succeeded.
Examples
Example 1: Import a module
New-AzAutomationModule -AutomationAccountName "Contoso17" -Name "ContosoModule" -ContentLink "http://contosostorage.blob.core.windows.net/modules/ContosoModule.zip" -ResourceGroupName "ResourceGroup01"
This command imports a module named ContosoModule into the Automation account named Contoso17. The module is stored in an Azure blob in a storage account named contosostorage and a container named modules.
Parameters
-AutomationAccountName
Specifies the name of the Automation account for which this cmdlet imports a module.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ContentLinkUri
The url to a module zip package
Parameter properties
| Type: | Uri |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | ContentLink |
Parameter sets
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure
Parameter properties
| Type: | IAzureContextContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
-Name
Specifies the name of the module that this cmdlet imports.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ResourceGroupName
Specifies the name of a resource group for which this cmdlet imports a module.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-RuntimeVersion
Runtime Environment of module
Parameter properties
| Type: | String |
| Default value: | None |
| Accepted values: | 5.1, 7.2 |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
String
Uri
Outputs
Module
Related Links
Azure PowerShell
Feedback
Was this page helpful?
