Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-shandar committed Sep 14, 2017
1 parent e89a548 commit 24c2a66
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
11 changes: 8 additions & 3 deletions experiments/Compute.Experiments/AzureRM.Compute.Experiments.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,34 @@
function New-AzVm {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)][string] $Name = "VM",
[Parameter(Mandatory=$true, Position=0)][string] $Name = "VM",
[Parameter()][PSCredential] $Credential,
[Parameter()][string] $ImageName = "Win2012R2Datacenter",
[Parameter()][string] $ResourceGroupName,
[Parameter()][string] $Location,
[Parameter()][string] $VirtualNetworkName,
[Parameter()][string] $PublicIpAddressName,
[Parameter()][string] $SecurityGroupName
# [Parameter()][string] $NetworkInterfaceName
)

PROCESS {
$rgi = [ResourceGroup]::new($ResourceGroupName);

$vni = [VirtualNetwork]::new($VirtualNetworkName);
$piai = [PublicIpAddress]::new($PublicIpAddressName);
$sgi = [SecurityGroup]::new($SecurityGroupName);

# we don't allow to reuse NetworkInterface so $name is $null.
$nii = [NetworkInterface]::new(
$null, # $NetworkInterfaceName,
$null,
$vni,
$piai,
$sgi);

# the purpouse of the New-AzVm cmdlet is to create (not get) a VM so $name is $null.
$vmi = [VirtualMachine]::new($null, $nii, $rgi, $Credential, $ImageName, $images);

# infer a location
$locationi = [Location]::new();
if (-not $Location) {
$vmi.UpdateLocation($locationi);
Expand Down
42 changes: 21 additions & 21 deletions experiments/Compute.Experiments/docs/New-AzVm.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
external help file: AzureRM.Compute.Experiments-help.xml
Module Name: AzureRM.Compute.Experiments
online version:
online version:
schema: 2.0.0
---

# New-AzVm

## SYNOPSIS
{{Fill in the Synopsis}}
Creates a virtual machine and all required resources.

## SYNTAX

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

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

## EXAMPLES

### Example 1
```
PS C:\> {{ Add example code here }}
PS C:\> New-AzVm -Name MyCoolVM
```

{{ Add example description here }}
Creates a virtual machine with name `MyCoolVM`.

## PARAMETERS

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

```yaml
Type: PSCredential
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: 1
Expand All @@ -48,12 +48,12 @@ Accept wildcard characters: False
```
### -ImageName
{{Fill ImageName Description}}
A name of virtual machine image.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: 2
Expand All @@ -63,12 +63,12 @@ Accept wildcard characters: False
```
### -Location
{{Fill Location Description}}
Specifies a location for the virtual machine.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: 4
Expand All @@ -78,12 +78,12 @@ Accept wildcard characters: False
```
### -Name
{{Fill Name Description}}
A name of a virtual machine.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: 0
Expand All @@ -93,12 +93,12 @@ Accept wildcard characters: False
```
### -PublicIpAddressName
{{Fill PublicIpAddressName Description}}
Specifies a name of PublicIPAddress object to assign to a network interface.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: 6
Expand All @@ -108,12 +108,12 @@ Accept wildcard characters: False
```
### -ResourceGroupName
{{Fill ResourceGroupName Description}}
Specifies the name of a resource group.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: 3
Expand All @@ -123,12 +123,12 @@ Accept wildcard characters: False
```
### -SecurityGroupName
{{Fill SecurityGroupName Description}}
Specifies a Network Security Group name.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: 7
Expand All @@ -138,12 +138,12 @@ Accept wildcard characters: False
```
### -VirtualNetworkName
{{Fill VirtualNetworkName Description}}
Specifies a Virtual Network name.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: 5
Expand Down

0 comments on commit 24c2a66

Please sign in to comment.