Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ResourceManager/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Current Release
* Add DisableVMAgent switch parameter to `Set-AzureRmVMOperatingSystem` cmdlet
* `New-AzureRmVm` and `New-AzureRmVmss` (simple parameter set) support a `Win10` image.
* `Repair-AzureRmVmssServiceFabricUpdateDomain` cmdlet is added.
* Set minimum dependency of module to PowerShell 5.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,4 +399,13 @@ function Test-VirtualMachineProfileWithoutAUC
# Verify Additional Unattend Content
Assert-Null $p.OSProfile.WindowsConfiguration.AdditionalUnattendContent "NULL";
Assert-False {$p.OSProfile.WindowsConfiguration.AdditionalUnattendContent.IsInitialized};

$p.OSProfile = $null;
$p = Set-AzureRmVMOperatingSystem -VM $p -Windows -ComputerName $computerName -Credential $cred;
Assert-Null $p.OSProfile.WindowsConfiguration.ProvisionVMAgent;

$p.OSProfile = $null;
$p = Set-AzureRmVMOperatingSystem -VM $p -Windows -ComputerName $computerName -Credential $cred -DisableVMAgent;
Assert-False {$p.OSProfile.WindowsConfiguration.ProvisionVMAgent};

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public class SetAzureVMOperatingSystemCommand : Microsoft.Azure.Commands.Resourc
{
protected const string WindowsParamSet = "Windows";
protected const string WinRmHttpsParamSet = "WindowsWinRmHttps";
protected const string WindowsDisableVMAgentParamSet = "WindowsDisableVMAgent";
protected const string WindowsDisableVMAgentWinRmHttpsParamSet = "WindowsDisableVMAgentWinRmHttps";
protected const string LinuxParamSet = "Linux";

[Alias("VMProfile")]
Expand All @@ -60,6 +62,18 @@ public class SetAzureVMOperatingSystemCommand : Microsoft.Azure.Commands.Resourc
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Windows")]
[Parameter(
ParameterSetName = WindowsDisableVMAgentParamSet,
Mandatory = true,
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Windows")]
[Parameter(
ParameterSetName = WindowsDisableVMAgentWinRmHttpsParamSet,
Mandatory = true,
Position = 1,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Windows")]
[ValidateNotNullOrEmpty]
public SwitchParameter Windows { get; set; }

Expand Down Expand Up @@ -108,6 +122,15 @@ public class SetAzureVMOperatingSystemCommand : Microsoft.Azure.Commands.Resourc
[ValidateNotNullOrEmpty]
public SwitchParameter ProvisionVMAgent { get; set; }

[Parameter(
ParameterSetName = WindowsDisableVMAgentParamSet,
HelpMessage = "Disable Provision VM Agent.")]
[Parameter(
ParameterSetName = WindowsDisableVMAgentWinRmHttpsParamSet,
HelpMessage = "Disable Provision VM Agent.")]
[ValidateNotNullOrEmpty]
public SwitchParameter DisableVMAgent { get; set; }

[Parameter(
ParameterSetName = WindowsParamSet,
Position = 6,
Expand All @@ -118,6 +141,16 @@ public class SetAzureVMOperatingSystemCommand : Microsoft.Azure.Commands.Resourc
Position = 6,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Enable Automatic Update")]
[Parameter(
ParameterSetName = WindowsDisableVMAgentParamSet,
Position = 6,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Enable Automatic Update")]
[Parameter(
ParameterSetName = WindowsDisableVMAgentWinRmHttpsParamSet,
Position = 6,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Enable Automatic Update")]
[ValidateNotNullOrEmpty]
public SwitchParameter EnableAutoUpdate { get; set; }

Expand All @@ -131,6 +164,16 @@ public class SetAzureVMOperatingSystemCommand : Microsoft.Azure.Commands.Resourc
Position = 7,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Time Zone")]
[Parameter(
ParameterSetName = WindowsDisableVMAgentParamSet,
Position = 7,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Time Zone")]
[Parameter(
ParameterSetName = WindowsDisableVMAgentWinRmHttpsParamSet,
Position = 7,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Time Zone")]
[ValidateNotNullOrEmpty]
public string TimeZone { get; set; }

Expand All @@ -144,6 +187,16 @@ public class SetAzureVMOperatingSystemCommand : Microsoft.Azure.Commands.Resourc
Position = 8,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Enable WinRM Http protocol")]
[Parameter(
ParameterSetName = WindowsDisableVMAgentParamSet,
Position = 8,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Enable WinRM Http protocol")]
[Parameter(
ParameterSetName = WindowsDisableVMAgentWinRmHttpsParamSet,
Position = 8,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Enable WinRM Http protocol")]
[ValidateNotNullOrEmpty]
public SwitchParameter WinRMHttp { get; set; }

Expand All @@ -153,6 +206,12 @@ public class SetAzureVMOperatingSystemCommand : Microsoft.Azure.Commands.Resourc
Position = 9,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Enable WinRM Https protocol")]
[Parameter(
Mandatory = true,
ParameterSetName = WindowsDisableVMAgentWinRmHttpsParamSet,
Position = 9,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Enable WinRM Https protocol")]
[ValidateNotNullOrEmpty]
public SwitchParameter WinRMHttps { get; set; }

Expand All @@ -162,6 +221,12 @@ public class SetAzureVMOperatingSystemCommand : Microsoft.Azure.Commands.Resourc
Position = 10,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Url for WinRM certificate")]
[Parameter(
Mandatory = true,
ParameterSetName = WindowsDisableVMAgentWinRmHttpsParamSet,
Position = 10,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Url for WinRM certificate")]
[ValidateNotNullOrEmpty]
public Uri WinRMCertificateUrl { get; set; }

Expand Down Expand Up @@ -238,7 +303,17 @@ public override void ExecuteCmdlet()
}

// OS Profile
this.VM.OSProfile.WindowsConfiguration.ProvisionVMAgent = this.ProvisionVMAgent.IsPresent;
this.VM.OSProfile.WindowsConfiguration.ProvisionVMAgent = this.VM.OSProfile.WindowsConfiguration.ProvisionVMAgent;

if (this.ProvisionVMAgent.IsPresent)
{
this.VM.OSProfile.WindowsConfiguration.ProvisionVMAgent = true;
}

if (this.DisableVMAgent.IsPresent)
{
this.VM.OSProfile.WindowsConfiguration.ProvisionVMAgent = false;
}

this.VM.OSProfile.WindowsConfiguration.EnableAutomaticUpdates = this.EnableAutoUpdate.IsPresent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@ Set-AzureRmVMOperatingSystem [-VM] <PSVirtualMachine> [-Windows] [-ComputerName]
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

### WindowsDisableVMAgent
```
Set-AzureRmVMOperatingSystem [-VM] <PSVirtualMachine> [-Windows] [-ComputerName] <String>
[-Credential] <PSCredential> [[-CustomData] <String>] [-DisableVMAgent] [-EnableAutoUpdate]
[[-TimeZone] <String>] [-WinRMHttp] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

### WindowsDisableVMAgentWinRmHttps
```
Set-AzureRmVMOperatingSystem [-VM] <PSVirtualMachine> [-Windows] [-ComputerName] <String>
[-Credential] <PSCredential> [[-CustomData] <String>] [-DisableVMAgent] [-EnableAutoUpdate]
[[-TimeZone] <String>] [-WinRMHttp] [-WinRMHttps] [-WinRMCertificateUrl] <Uri>
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

### Linux
```
Set-AzureRmVMOperatingSystem [-VM] <PSVirtualMachine> [-Linux] [-ComputerName] <String>
Expand Down Expand Up @@ -155,12 +170,27 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -DisableVMAgent
Disable Provision VM Agent.

```yaml
Type: SwitchParameter
Parameter Sets: WindowsDisableVMAgent, WindowsDisableVMAgentWinRmHttps
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -EnableAutoUpdate
Indicates that this cmdlet enables auto update.

```yaml
Type: SwitchParameter
Parameter Sets: Windows, WindowsWinRmHttps
Parameter Sets: Windows, WindowsWinRmHttps, WindowsDisableVMAgent, WindowsDisableVMAgentWinRmHttps
Aliases:

Required: False
Expand Down Expand Up @@ -205,7 +235,7 @@ Specifies the time zone for the virtual machine.

```yaml
Type: String
Parameter Sets: Windows, WindowsWinRmHttps
Parameter Sets: Windows, WindowsWinRmHttps, WindowsDisableVMAgent, WindowsDisableVMAgentWinRmHttps
Aliases:

Required: False
Expand Down Expand Up @@ -237,7 +267,7 @@ Indicates that the type of operating system is Windows.

```yaml
Type: SwitchParameter
Parameter Sets: Windows, WindowsWinRmHttps
Parameter Sets: Windows, WindowsWinRmHttps, WindowsDisableVMAgent, WindowsDisableVMAgentWinRmHttps
Aliases:

Required: True
Expand All @@ -253,7 +283,7 @@ This needs to be stored in a Key Vault.

```yaml
Type: Uri
Parameter Sets: WindowsWinRmHttps
Parameter Sets: WindowsWinRmHttps, WindowsDisableVMAgentWinRmHttps
Aliases:

Required: True
Expand All @@ -268,7 +298,7 @@ Indicates that this operating system uses HTTP WinRM.

```yaml
Type: SwitchParameter
Parameter Sets: Windows, WindowsWinRmHttps
Parameter Sets: Windows, WindowsWinRmHttps, WindowsDisableVMAgent, WindowsDisableVMAgentWinRmHttps
Aliases:

Required: False
Expand All @@ -283,7 +313,7 @@ Indicates that this operating system uses HTTPS WinRM.

```yaml
Type: SwitchParameter
Parameter Sets: WindowsWinRmHttps
Parameter Sets: WindowsWinRmHttps, WindowsDisableVMAgentWinRmHttps
Aliases:

Required: True
Expand Down