Invoke-​Azure​Rm​Server​Management​Power​Shell​Command

Executes a Windows PowerShell script block on a node.

Syntax

Invoke-AzureRmServerManagementPowerShellCommand
      [-ResourceGroupName] <String>
      [-NodeName] <String>
      [-SessionName] <String>
      [-Command] <ScriptBlock>
      [-PowerShellSessionName <String>]
      [-RawOutput]
      [<CommonParameters>]
Invoke-AzureRmServerManagementPowerShellCommand
      [-Session] <Session>
      [-Command] <ScriptBlock>
      [-PowerShellSessionName <String>]
      [-RawOutput]
      [<CommonParameters>]

Description

The Invoke-AzureRmServerManagementPowerShellCommand cmdlet executes a Windows PowerShell script block on a node managed by an Azure Server Management Gateway.

Examples

1:

Required Parameters

-Command

Specifies the script block to run on the target node.

Type:ScriptBlock
Position:3
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-NodeName

Specifies the name of the node to run the script block on.

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

Specifies the name of the resource group that the node belongs to.

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

Specifies the Session object that this cmdlet uses to connect to the target node.

This parameter may be specified instead of the ResourceGroupName, NodeName, SessionName, and PowerShellSessionName parameters.

Type:Session
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-SessionName

Specifies the name of the session to manage the node.

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

Optional Parameters

-PowerShellSessionName

Specifies the name of the Windows PowerShell run space on the target node.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RawOutput

Indicates that the cmdlet returns the complete object that contains the output from the node.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False