1. Packages
  2. Azure Classic
  3. API Docs
  4. automation
  5. Powershell72Module

We recommend using Azure Native.

Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi

azure.automation.Powershell72Module

Explore with Pulumi AI

Manages a Automation Powershell 7.2 Module.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = new azure.core.ResourceGroup("example", {
    name: "example-resources",
    location: "West Europe",
});
const exampleAccount = new azure.automation.Account("example", {
    name: "account1",
    location: example.location,
    resourceGroupName: example.name,
    skuName: "Basic",
});
const examplePowershell72Module = new azure.automation.Powershell72Module("example", {
    name: "xActiveDirectory",
    automationAccountId: exampleAccount.id,
    moduleLink: {
        uri: "https://devopsgallerystorage.blob.core.windows.net/packages/xactivedirectory.2.19.0.nupkg",
    },
});
Copy
import pulumi
import pulumi_azure as azure

example = azure.core.ResourceGroup("example",
    name="example-resources",
    location="West Europe")
example_account = azure.automation.Account("example",
    name="account1",
    location=example.location,
    resource_group_name=example.name,
    sku_name="Basic")
example_powershell72_module = azure.automation.Powershell72Module("example",
    name="xActiveDirectory",
    automation_account_id=example_account.id,
    module_link={
        "uri": "https://devopsgallerystorage.blob.core.windows.net/packages/xactivedirectory.2.19.0.nupkg",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/automation"
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
			Name:     pulumi.String("example-resources"),
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleAccount, err := automation.NewAccount(ctx, "example", &automation.AccountArgs{
			Name:              pulumi.String("account1"),
			Location:          example.Location,
			ResourceGroupName: example.Name,
			SkuName:           pulumi.String("Basic"),
		})
		if err != nil {
			return err
		}
		_, err = automation.NewPowershell72Module(ctx, "example", &automation.Powershell72ModuleArgs{
			Name:                pulumi.String("xActiveDirectory"),
			AutomationAccountId: exampleAccount.ID(),
			ModuleLink: &automation.Powershell72ModuleModuleLinkArgs{
				Uri: pulumi.String("https://devopsgallerystorage.blob.core.windows.net/packages/xactivedirectory.2.19.0.nupkg"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = new Azure.Core.ResourceGroup("example", new()
    {
        Name = "example-resources",
        Location = "West Europe",
    });

    var exampleAccount = new Azure.Automation.Account("example", new()
    {
        Name = "account1",
        Location = example.Location,
        ResourceGroupName = example.Name,
        SkuName = "Basic",
    });

    var examplePowershell72Module = new Azure.Automation.Powershell72Module("example", new()
    {
        Name = "xActiveDirectory",
        AutomationAccountId = exampleAccount.Id,
        ModuleLink = new Azure.Automation.Inputs.Powershell72ModuleModuleLinkArgs
        {
            Uri = "https://devopsgallerystorage.blob.core.windows.net/packages/xactivedirectory.2.19.0.nupkg",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.automation.Account;
import com.pulumi.azure.automation.AccountArgs;
import com.pulumi.azure.automation.Powershell72Module;
import com.pulumi.azure.automation.Powershell72ModuleArgs;
import com.pulumi.azure.automation.inputs.Powershell72ModuleModuleLinkArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new ResourceGroup("example", ResourceGroupArgs.builder()
            .name("example-resources")
            .location("West Europe")
            .build());

        var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
            .name("account1")
            .location(example.location())
            .resourceGroupName(example.name())
            .skuName("Basic")
            .build());

        var examplePowershell72Module = new Powershell72Module("examplePowershell72Module", Powershell72ModuleArgs.builder()
            .name("xActiveDirectory")
            .automationAccountId(exampleAccount.id())
            .moduleLink(Powershell72ModuleModuleLinkArgs.builder()
                .uri("https://devopsgallerystorage.blob.core.windows.net/packages/xactivedirectory.2.19.0.nupkg")
                .build())
            .build());

    }
}
Copy
resources:
  example:
    type: azure:core:ResourceGroup
    properties:
      name: example-resources
      location: West Europe
  exampleAccount:
    type: azure:automation:Account
    name: example
    properties:
      name: account1
      location: ${example.location}
      resourceGroupName: ${example.name}
      skuName: Basic
  examplePowershell72Module:
    type: azure:automation:Powershell72Module
    name: example
    properties:
      name: xActiveDirectory
      automationAccountId: ${exampleAccount.id}
      moduleLink:
        uri: https://devopsgallerystorage.blob.core.windows.net/packages/xactivedirectory.2.19.0.nupkg
Copy

Create Powershell72Module Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Powershell72Module(name: string, args: Powershell72ModuleArgs, opts?: CustomResourceOptions);
@overload
def Powershell72Module(resource_name: str,
                       args: Powershell72ModuleArgs,
                       opts: Optional[ResourceOptions] = None)

@overload
def Powershell72Module(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       automation_account_id: Optional[str] = None,
                       module_link: Optional[Powershell72ModuleModuleLinkArgs] = None,
                       name: Optional[str] = None,
                       tags: Optional[Mapping[str, str]] = None)
func NewPowershell72Module(ctx *Context, name string, args Powershell72ModuleArgs, opts ...ResourceOption) (*Powershell72Module, error)
public Powershell72Module(string name, Powershell72ModuleArgs args, CustomResourceOptions? opts = null)
public Powershell72Module(String name, Powershell72ModuleArgs args)
public Powershell72Module(String name, Powershell72ModuleArgs args, CustomResourceOptions options)
type: azure:automation:Powershell72Module
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. Powershell72ModuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. Powershell72ModuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. Powershell72ModuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. Powershell72ModuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. Powershell72ModuleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var powershell72ModuleResource = new Azure.Automation.Powershell72Module("powershell72ModuleResource", new()
{
    AutomationAccountId = "string",
    ModuleLink = new Azure.Automation.Inputs.Powershell72ModuleModuleLinkArgs
    {
        Uri = "string",
        Hash = new Azure.Automation.Inputs.Powershell72ModuleModuleLinkHashArgs
        {
            Algorithm = "string",
            Value = "string",
        },
    },
    Name = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := automation.NewPowershell72Module(ctx, "powershell72ModuleResource", &automation.Powershell72ModuleArgs{
	AutomationAccountId: pulumi.String("string"),
	ModuleLink: &automation.Powershell72ModuleModuleLinkArgs{
		Uri: pulumi.String("string"),
		Hash: &automation.Powershell72ModuleModuleLinkHashArgs{
			Algorithm: pulumi.String("string"),
			Value:     pulumi.String("string"),
		},
	},
	Name: pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var powershell72ModuleResource = new Powershell72Module("powershell72ModuleResource", Powershell72ModuleArgs.builder()
    .automationAccountId("string")
    .moduleLink(Powershell72ModuleModuleLinkArgs.builder()
        .uri("string")
        .hash(Powershell72ModuleModuleLinkHashArgs.builder()
            .algorithm("string")
            .value("string")
            .build())
        .build())
    .name("string")
    .tags(Map.of("string", "string"))
    .build());
Copy
powershell72_module_resource = azure.automation.Powershell72Module("powershell72ModuleResource",
    automation_account_id="string",
    module_link={
        "uri": "string",
        "hash": {
            "algorithm": "string",
            "value": "string",
        },
    },
    name="string",
    tags={
        "string": "string",
    })
Copy
const powershell72ModuleResource = new azure.automation.Powershell72Module("powershell72ModuleResource", {
    automationAccountId: "string",
    moduleLink: {
        uri: "string",
        hash: {
            algorithm: "string",
            value: "string",
        },
    },
    name: "string",
    tags: {
        string: "string",
    },
});
Copy
type: azure:automation:Powershell72Module
properties:
    automationAccountId: string
    moduleLink:
        hash:
            algorithm: string
            value: string
        uri: string
    name: string
    tags:
        string: string
Copy

Powershell72Module Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Powershell72Module resource accepts the following input properties:

AutomationAccountId
This property is required.
Changes to this property will trigger replacement.
string
The ID of Automation Account to manage this Watcher. Changing this forces a new Watcher to be created.
ModuleLink This property is required. Powershell72ModuleModuleLink
A module_link block as defined below.
Name Changes to this property will trigger replacement. string
Specifies the name of the Module. Changing this forces a new resource to be created.
Tags Dictionary<string, string>
A mapping of tags to assign to the resource.
AutomationAccountId
This property is required.
Changes to this property will trigger replacement.
string
The ID of Automation Account to manage this Watcher. Changing this forces a new Watcher to be created.
ModuleLink This property is required. Powershell72ModuleModuleLinkArgs
A module_link block as defined below.
Name Changes to this property will trigger replacement. string
Specifies the name of the Module. Changing this forces a new resource to be created.
Tags map[string]string
A mapping of tags to assign to the resource.
automationAccountId
This property is required.
Changes to this property will trigger replacement.
String
The ID of Automation Account to manage this Watcher. Changing this forces a new Watcher to be created.
moduleLink This property is required. Powershell72ModuleModuleLink
A module_link block as defined below.
name Changes to this property will trigger replacement. String
Specifies the name of the Module. Changing this forces a new resource to be created.
tags Map<String,String>
A mapping of tags to assign to the resource.
automationAccountId
This property is required.
Changes to this property will trigger replacement.
string
The ID of Automation Account to manage this Watcher. Changing this forces a new Watcher to be created.
moduleLink This property is required. Powershell72ModuleModuleLink
A module_link block as defined below.
name Changes to this property will trigger replacement. string
Specifies the name of the Module. Changing this forces a new resource to be created.
tags {[key: string]: string}
A mapping of tags to assign to the resource.
automation_account_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of Automation Account to manage this Watcher. Changing this forces a new Watcher to be created.
module_link This property is required. Powershell72ModuleModuleLinkArgs
A module_link block as defined below.
name Changes to this property will trigger replacement. str
Specifies the name of the Module. Changing this forces a new resource to be created.
tags Mapping[str, str]
A mapping of tags to assign to the resource.
automationAccountId
This property is required.
Changes to this property will trigger replacement.
String
The ID of Automation Account to manage this Watcher. Changing this forces a new Watcher to be created.
moduleLink This property is required. Property Map
A module_link block as defined below.
name Changes to this property will trigger replacement. String
Specifies the name of the Module. Changing this forces a new resource to be created.
tags Map<String>
A mapping of tags to assign to the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the Powershell72Module resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing Powershell72Module Resource

Get an existing Powershell72Module resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: Powershell72ModuleState, opts?: CustomResourceOptions): Powershell72Module
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        automation_account_id: Optional[str] = None,
        module_link: Optional[Powershell72ModuleModuleLinkArgs] = None,
        name: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None) -> Powershell72Module
func GetPowershell72Module(ctx *Context, name string, id IDInput, state *Powershell72ModuleState, opts ...ResourceOption) (*Powershell72Module, error)
public static Powershell72Module Get(string name, Input<string> id, Powershell72ModuleState? state, CustomResourceOptions? opts = null)
public static Powershell72Module get(String name, Output<String> id, Powershell72ModuleState state, CustomResourceOptions options)
resources:  _:    type: azure:automation:Powershell72Module    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AutomationAccountId Changes to this property will trigger replacement. string
The ID of Automation Account to manage this Watcher. Changing this forces a new Watcher to be created.
ModuleLink Powershell72ModuleModuleLink
A module_link block as defined below.
Name Changes to this property will trigger replacement. string
Specifies the name of the Module. Changing this forces a new resource to be created.
Tags Dictionary<string, string>
A mapping of tags to assign to the resource.
AutomationAccountId Changes to this property will trigger replacement. string
The ID of Automation Account to manage this Watcher. Changing this forces a new Watcher to be created.
ModuleLink Powershell72ModuleModuleLinkArgs
A module_link block as defined below.
Name Changes to this property will trigger replacement. string
Specifies the name of the Module. Changing this forces a new resource to be created.
Tags map[string]string
A mapping of tags to assign to the resource.
automationAccountId Changes to this property will trigger replacement. String
The ID of Automation Account to manage this Watcher. Changing this forces a new Watcher to be created.
moduleLink Powershell72ModuleModuleLink
A module_link block as defined below.
name Changes to this property will trigger replacement. String
Specifies the name of the Module. Changing this forces a new resource to be created.
tags Map<String,String>
A mapping of tags to assign to the resource.
automationAccountId Changes to this property will trigger replacement. string
The ID of Automation Account to manage this Watcher. Changing this forces a new Watcher to be created.
moduleLink Powershell72ModuleModuleLink
A module_link block as defined below.
name Changes to this property will trigger replacement. string
Specifies the name of the Module. Changing this forces a new resource to be created.
tags {[key: string]: string}
A mapping of tags to assign to the resource.
automation_account_id Changes to this property will trigger replacement. str
The ID of Automation Account to manage this Watcher. Changing this forces a new Watcher to be created.
module_link Powershell72ModuleModuleLinkArgs
A module_link block as defined below.
name Changes to this property will trigger replacement. str
Specifies the name of the Module. Changing this forces a new resource to be created.
tags Mapping[str, str]
A mapping of tags to assign to the resource.
automationAccountId Changes to this property will trigger replacement. String
The ID of Automation Account to manage this Watcher. Changing this forces a new Watcher to be created.
moduleLink Property Map
A module_link block as defined below.
name Changes to this property will trigger replacement. String
Specifies the name of the Module. Changing this forces a new resource to be created.
tags Map<String>
A mapping of tags to assign to the resource.

Supporting Types

Uri This property is required. string
The URI of the module content (zip or nupkg).
Hash Powershell72ModuleModuleLinkHash
A hash block as defined below.
Uri This property is required. string
The URI of the module content (zip or nupkg).
Hash Powershell72ModuleModuleLinkHash
A hash block as defined below.
uri This property is required. String
The URI of the module content (zip or nupkg).
hash Powershell72ModuleModuleLinkHash
A hash block as defined below.
uri This property is required. string
The URI of the module content (zip or nupkg).
hash Powershell72ModuleModuleLinkHash
A hash block as defined below.
uri This property is required. str
The URI of the module content (zip or nupkg).
hash Powershell72ModuleModuleLinkHash
A hash block as defined below.
uri This property is required. String
The URI of the module content (zip or nupkg).
hash Property Map
A hash block as defined below.

Powershell72ModuleModuleLinkHash
, Powershell72ModuleModuleLinkHashArgs

Algorithm This property is required. string
Specifies the algorithm used for the hash content.
Value This property is required. string
The hash value of the content.
Algorithm This property is required. string
Specifies the algorithm used for the hash content.
Value This property is required. string
The hash value of the content.
algorithm This property is required. String
Specifies the algorithm used for the hash content.
value This property is required. String
The hash value of the content.
algorithm This property is required. string
Specifies the algorithm used for the hash content.
value This property is required. string
The hash value of the content.
algorithm This property is required. str
Specifies the algorithm used for the hash content.
value This property is required. str
The hash value of the content.
algorithm This property is required. String
Specifies the algorithm used for the hash content.
value This property is required. String
The hash value of the content.

Import

Automation Modules can be imported using the resource id, e.g.

$ pulumi import azure:automation/powershell72Module:Powershell72Module module1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/powerShell72Modules/module1
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.