Skip to content

Commit 24c2a66

Browse files
docs
1 parent e89a548 commit 24c2a66

File tree

2 files changed

+29
-24
lines changed

2 files changed

+29
-24
lines changed

experiments/Compute.Experiments/AzureRM.Compute.Experiments.psm1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,34 @@
44
function New-AzVm {
55
[CmdletBinding()]
66
param (
7-
[Parameter(Mandatory=$true)][string] $Name = "VM",
7+
[Parameter(Mandatory=$true, Position=0)][string] $Name = "VM",
88
[Parameter()][PSCredential] $Credential,
99
[Parameter()][string] $ImageName = "Win2012R2Datacenter",
1010
[Parameter()][string] $ResourceGroupName,
1111
[Parameter()][string] $Location,
1212
[Parameter()][string] $VirtualNetworkName,
1313
[Parameter()][string] $PublicIpAddressName,
1414
[Parameter()][string] $SecurityGroupName
15-
# [Parameter()][string] $NetworkInterfaceName
1615
)
1716

1817
PROCESS {
1918
$rgi = [ResourceGroup]::new($ResourceGroupName);
19+
2020
$vni = [VirtualNetwork]::new($VirtualNetworkName);
2121
$piai = [PublicIpAddress]::new($PublicIpAddressName);
2222
$sgi = [SecurityGroup]::new($SecurityGroupName);
23+
24+
# we don't allow to reuse NetworkInterface so $name is $null.
2325
$nii = [NetworkInterface]::new(
24-
$null, # $NetworkInterfaceName,
26+
$null,
2527
$vni,
2628
$piai,
2729
$sgi);
30+
31+
# the purpouse of the New-AzVm cmdlet is to create (not get) a VM so $name is $null.
2832
$vmi = [VirtualMachine]::new($null, $nii, $rgi, $Credential, $ImageName, $images);
2933

34+
# infer a location
3035
$locationi = [Location]::new();
3136
if (-not $Location) {
3237
$vmi.UpdateLocation($locationi);

experiments/Compute.Experiments/docs/New-AzVm.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
external help file: AzureRM.Compute.Experiments-help.xml
33
Module Name: AzureRM.Compute.Experiments
4-
online version:
4+
online version:
55
schema: 2.0.0
66
---
77

88
# New-AzVm
99

1010
## SYNOPSIS
11-
{{Fill in the Synopsis}}
11+
Creates a virtual machine and all required resources.
1212

1313
## SYNTAX
1414

@@ -19,26 +19,26 @@ New-AzVm [-Name] <String> [[-Credential] <PSCredential>] [[-ImageName] <String>]
1919
```
2020

2121
## DESCRIPTION
22-
{{Fill in the Description}}
22+
The cmdlet creates a virtual machine and all required resources in Azure.
2323

2424
## EXAMPLES
2525

2626
### Example 1
2727
```
28-
PS C:\> {{ Add example code here }}
28+
PS C:\> New-AzVm -Name MyCoolVM
2929
```
3030

31-
{{ Add example description here }}
31+
Creates a virtual machine with name `MyCoolVM`.
3232

3333
## PARAMETERS
3434

3535
### -Credential
36-
{{Fill Credential Description}}
36+
Specifies the user name and password for the virtual machine as a PSCredential object.
3737

3838
```yaml
3939
Type: PSCredential
4040
Parameter Sets: (All)
41-
Aliases:
41+
Aliases:
4242

4343
Required: False
4444
Position: 1
@@ -48,12 +48,12 @@ Accept wildcard characters: False
4848
```
4949
5050
### -ImageName
51-
{{Fill ImageName Description}}
51+
A name of virtual machine image.
5252
5353
```yaml
5454
Type: String
5555
Parameter Sets: (All)
56-
Aliases:
56+
Aliases:
5757

5858
Required: False
5959
Position: 2
@@ -63,12 +63,12 @@ Accept wildcard characters: False
6363
```
6464
6565
### -Location
66-
{{Fill Location Description}}
66+
Specifies a location for the virtual machine.
6767
6868
```yaml
6969
Type: String
7070
Parameter Sets: (All)
71-
Aliases:
71+
Aliases:
7272

7373
Required: False
7474
Position: 4
@@ -78,12 +78,12 @@ Accept wildcard characters: False
7878
```
7979
8080
### -Name
81-
{{Fill Name Description}}
81+
A name of a virtual machine.
8282
8383
```yaml
8484
Type: String
8585
Parameter Sets: (All)
86-
Aliases:
86+
Aliases:
8787

8888
Required: True
8989
Position: 0
@@ -93,12 +93,12 @@ Accept wildcard characters: False
9393
```
9494
9595
### -PublicIpAddressName
96-
{{Fill PublicIpAddressName Description}}
96+
Specifies a name of PublicIPAddress object to assign to a network interface.
9797
9898
```yaml
9999
Type: String
100100
Parameter Sets: (All)
101-
Aliases:
101+
Aliases:
102102

103103
Required: False
104104
Position: 6
@@ -108,12 +108,12 @@ Accept wildcard characters: False
108108
```
109109
110110
### -ResourceGroupName
111-
{{Fill ResourceGroupName Description}}
111+
Specifies the name of a resource group.
112112
113113
```yaml
114114
Type: String
115115
Parameter Sets: (All)
116-
Aliases:
116+
Aliases:
117117

118118
Required: False
119119
Position: 3
@@ -123,12 +123,12 @@ Accept wildcard characters: False
123123
```
124124
125125
### -SecurityGroupName
126-
{{Fill SecurityGroupName Description}}
126+
Specifies a Network Security Group name.
127127
128128
```yaml
129129
Type: String
130130
Parameter Sets: (All)
131-
Aliases:
131+
Aliases:
132132

133133
Required: False
134134
Position: 7
@@ -138,12 +138,12 @@ Accept wildcard characters: False
138138
```
139139
140140
### -VirtualNetworkName
141-
{{Fill VirtualNetworkName Description}}
141+
Specifies a Virtual Network name.
142142
143143
```yaml
144144
Type: String
145145
Parameter Sets: (All)
146-
Aliases:
146+
Aliases:
147147

148148
Required: False
149149
Position: 5

0 commit comments

Comments
 (0)