Add-AzureHDInsightScriptAction
Add-AzureHDInsightScriptAction
Invokes a script action used to customize a cluster at deployment.
Syntax
Parameter Set: Add Script Action
Add-AzureHDInsightScriptAction [-Config] <AzureHDInsightConfig> [-Name] <String> [-ClusterRoleCollection] <ClusterNodeType[]> [-Uri] <Uri> [[-Parameters] <String> ] [ <CommonParameters>]
Detailed Description
Provides Azure HDInsight functionality that is used to install additional software or to change the configuration of applications running on an Hadoop cluster using PowerShell scripts. Script Actions are scripts that run on the cluster nodes when HDInsight clusters are deployed and they are executed once nodes in the cluster complete HDInsight configuration. The script action is executed under system admin account privileges and provide full access rights to the cluster nodes. Each cluster can be provided with a list of script actions to execute that will be executed in the order in which they are specified.
This topic describes the cmdlet in the 0.8.11 version of the Microsoft Azure HDInsight PowerShell module. To get the version of the module you're currently using, type (Get-Module –Name Azure).Version
in the Azure PowerShell console.
Parameters
-ClusterRoleCollection<ClusterNodeType[]>
Specifies the nodes on which the customization script is run. The valid values are HeadNode or DataNode. You can use either or both values.
Aliases |
none |
Required? |
true |
Position? |
3 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Config<AzureHDInsightConfig>
The configuration object to which script action information is added.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
-Name<String>
Name of the script action.
Aliases |
none |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Parameters<String>
Parameters required by the script.
Aliases |
none |
Required? |
false |
Position? |
5 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Uri<Uri>
Specifies the URI to the script that is executed.
Aliases |
none |
Required? |
true |
Position? |
4 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Run a single Script Action
Use the following PowerShell command to run a single Script Action when deploying a cluster.
PS C:\>
$config = New-AzureHDInsightClusterConfig –ClusterSizeInNodes 4
$config = Add-AzureHDInsightScriptAction -Config $config –Name TestScriptAction –Uri https://test.com/test.ps1 –Parameters test -ClusterRoleCollection HeadNode,DataNode
New-AzureHDInsightCluster -Config $config
Run multiple Script Actions
Use the following PowerShell command to run multiple Script Actions when deploying a cluster.
PS C:\>
$config = New-AzureHDInsightClusterConfig –ClusterSizeInNodes 4
$config = Add-AzureHDInsightScriptAction -Config $config –Name TestScriptAction1 –Uri https://test.com/test1.ps1 –Parameters test1 -ClusterRoleCollection HeadNode,DataNode | Add-AzureHDInsightScriptAction -Config $config –Name TestScriptAction2 –Uri https://test.com/test2.ps1 -ClusterRoleCollection HeadNode
New-AzureHDInsightCluster -Config $config