Skip to content

Commit

Permalink
Merge pull request #2 from sergey-shandar/sergey-compute-class
Browse files Browse the repository at this point in the history
Sergey compute class
  • Loading branch information
sergey-shandar authored Sep 14, 2017
2 parents d32bee0 + e89a548 commit 4575ee6
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $vmCredential = New-Object System.Management.Automation.PSCredential ($vmCompute

# $vm = New-AzVm
# $vm = New-AzVm -Credential $vmCredential
$vm = New-AzVm -Credential $vmCredential
$vm = New-AzVm -Name MyVM -Credential $vmCredential

$vm

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = ".\AzureRM.Compute.Experiments.psm1"

# Version number of this module.
ModuleVersion = '1.0.1'
ModuleVersion = '1.0.4'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
15 changes: 9 additions & 6 deletions experiments/Compute.Experiments/AzureRM.Compute.Experiments.psm1
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<#
.ExternalHelp AzureRM.Compute.Experiments-help.xml
#>
function New-AzVm {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)][string] $Name = "VM",
[Parameter()][PSCredential] $Credential,
[Parameter()][string] $Name = "VM",
[Parameter()][string] $ImageName = "Win2012R2Datacenter",
[Parameter()][string] $ResourceGroupName,
[Parameter()][string] $Location = "eastus",
[Parameter()][string] $Location,
[Parameter()][string] $VirtualNetworkName,
[Parameter()][string] $PublicIpAddressName,
[Parameter()][string] $SecurityGroupName,
[Parameter()][string] $NetworkInterfaceName
[Parameter()][string] $SecurityGroupName
# [Parameter()][string] $NetworkInterfaceName
)

PROCESS {
Expand All @@ -18,7 +21,7 @@ function New-AzVm {
$piai = [PublicIpAddress]::new($PublicIpAddressName);
$sgi = [SecurityGroup]::new($SecurityGroupName);
$nii = [NetworkInterface]::new(
$NetworkInterfaceName,
$null, # $NetworkInterfaceName,
$vni,
$piai,
$sgi);
Expand All @@ -39,7 +42,7 @@ function New-AzVm {

New-PsObject @{
ResourceId = $resourceGroup.ResourceId;
Response = $vmResponse
Response = $vmResponse;
}
}
}
Expand Down
167 changes: 167 additions & 0 deletions experiments/Compute.Experiments/docs/New-AzVm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
---
external help file: AzureRM.Compute.Experiments-help.xml
Module Name: AzureRM.Compute.Experiments
online version:
schema: 2.0.0
---

# New-AzVm

## SYNOPSIS
{{Fill in the Synopsis}}

## SYNTAX

```
New-AzVm [-Name] <String> [[-Credential] <PSCredential>] [[-ImageName] <String>]
[[-ResourceGroupName] <String>] [[-Location] <String>] [[-VirtualNetworkName] <String>]
[[-PublicIpAddressName] <String>] [[-SecurityGroupName] <String>]
```

## DESCRIPTION
{{Fill in the Description}}

## EXAMPLES

### Example 1
```
PS C:\> {{ Add example code here }}
```

{{ Add example description here }}

## PARAMETERS

### -Credential
{{Fill Credential Description}}

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

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ImageName
{{Fill ImageName Description}}
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Location
{{Fill Location Description}}
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Name
{{Fill Name Description}}
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -PublicIpAddressName
{{Fill PublicIpAddressName Description}}
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ResourceGroupName
{{Fill ResourceGroupName Description}}
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -SecurityGroupName
{{Fill SecurityGroupName Description}}
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -VirtualNetworkName
{{Fill VirtualNetworkName Description}}
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
## INPUTS
### None
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS
2 changes: 2 additions & 0 deletions experiments/Compute.Experiments/publish-dev.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
$out = "..\build\AzureRM.Compute.Experiments\"
$repository = "sergey"
$dep = @("AzureRM.Resources", "AzureRM.Network", "AzureRM.Compute")
Remove-Item $out -Recurse
mkdir $out
Copy-Item .\AzureRM.Compute.Experiments.psd1 $out
Copy-Item .\AzureRM.Compute.Experiments.psm1 $out
New-ExternalHelp -Path .\docs\ -OutputPath $out
foreach ($d in $dep) {
Install-Module $d -Repository $repository
}
Expand Down

0 comments on commit 4575ee6

Please sign in to comment.