external help file | Module Name | ms.assetid | online version | schema | content_git_url | original_content_git_url |
---|---|---|---|---|---|---|
Microsoft.Azure.PowerShell.Cmdlets.Automation.dll-Help.xml |
Az.Automation |
A06D36D7-3F72-4D21-8995-9DBBB9A9B880 |
2.0.0 |
Updates a module in Automation.
Set-AzAutomationModule [-Name] <String> [-ContentLinkUri <Uri>] [-ContentLinkVersion <String>]
[-RuntimeVersion <String>] [-ResourceGroupName] <String> [-AutomationAccountName] <String>
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
The Set-AzAutomationModule cmdlet updates a module in 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:
- wps_2 module, which has a .psm1 or .dll file name extension
- wps_2 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 wps_2 module into Automation by using this cmdlet or the New-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 -Name
ModuleName Check the ProvisioningState property for a value of Succeeded.
Set-AzAutomationModule -AutomationAccountName "Contoso17" -Name "ContosoModule" -ContentLinkUri "http://contosostorage.blob.core.windows.net/modules/ContosoModule.zip" -ContentLinkVersion "1.1" -ResourceGroupName "ResourceGroup01"
This command imports an updated version of an existing 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.
Specifies the name of the Automation account for which this cmdlet updates a module.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the URL of the .zip file that contains the new version of a module that this cmdlet imports.
Type: System.Uri
Parameter Sets: (All)
Aliases: ContentLink
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the version of the module to which this cmdlet updates Automation.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
The credentials, account, tenant, and subscription used for communication with azure
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Parameter Sets: (All)
Aliases: AzContext, AzureRmContext, AzureCredential
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the name of the module that this cmdlet imports.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the name of a resource group for which this cmdlet updates a module.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Runtime Environment of module
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: 5.1, 7.2
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.