Skip to content

Commit 5a74e7a

Browse files
authored
Merge pull request #4618 from sergey-shandar/sergey-compute-asjob
[Compute Experiments] AsJob, context and other paraemters
2 parents 127395f + f3103c8 commit 5a74e7a

File tree

6 files changed

+649
-273
lines changed

6 files changed

+649
-273
lines changed

experiments/Compute.Experiments/AzureRM.Compute.Experiments.Tests.ps1

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
Import-Module .\..\..\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Profile\AzureRM.Profile.psd1
2-
Import-Module .\..\..\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Resources\AzureRM.Resources.psd1
3-
Import-Module .\..\..\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Network\AzureRM.Network.psd1
4-
Import-Module .\..\..\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Compute\AzureRM.Compute.psd1
5-
Import-Module .\..\..\experiments\Compute.Experiments\AzureRM.Compute.Experiments.psd1
1+
$build = Resolve-Path "..\build\"
2+
$out = Join-Path $build "AzureRM.Compute.Experiments\"
3+
Copy-Item .\AzureRM.Compute.Experiments.psd1 $out
4+
Copy-Item .\AzureRM.Compute.Experiments.psm1 $out
5+
6+
$env:PSModulePath = $env:PSModulePath + ";" + $build.ToString()
67

78
# Login
89
$credentials = Get-Content -Path "C:\Users\sergey\Desktop\php-test.json" | ConvertFrom-Json
@@ -17,11 +18,23 @@ $vmCredential = New-Object System.Management.Automation.PSCredential ($vmCompute
1718

1819
New-AzVm -Name MyVM -Credential $vmCredential -WhatIf
1920

21+
# $job = New-AzVm -Name MyVMA -Credential $vmCredential -AsJob
22+
# Receive-Job $job
23+
24+
# exit
25+
2026
# $vm = New-AzVm
2127
# $vm = New-AzVm -Credential $vmCredential
22-
$vm = New-AzVm -Name MyVM -Credential $vmCredential
28+
$vm = New-AzVm -Name MyVMA1 -Credential $vmCredential -ResourceGroupName Crocodile
29+
# $vm = New-AzVm -Name MyVMA
2330

2431
$vm
2532

33+
# Write-Host "<async>"
34+
# $job = New-AzVm -Name MyVMA3 -Credential $vmCredential -AsJob
35+
# $vm = Receive-Job $job -Wait
36+
# $vm
37+
# Write-Host "</async>"
38+
2639
# clean-up
2740
Remove-AzureRmResourceGroup -ResourceId $vm.ResourceGroupId
Lines changed: 126 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,126 @@
1-
#
2-
# Module manifest for module 'AzureRM.Compute.Experiments'
3-
#
4-
# Generated by: Microsoft
5-
#
6-
# Generated on: 9/1/2017
7-
#
8-
9-
@{
10-
11-
# Script module or binary module file associated with this manifest.
12-
RootModule = ".\AzureRM.Compute.Experiments.psm1"
13-
14-
# Version number of this module.
15-
ModuleVersion = '1.0.7'
16-
17-
# Supported PSEditions
18-
# CompatiblePSEditions = @()
19-
20-
# ID used to uniquely identify this module
21-
GUID = 'b5a94030-df85-43fa-b581-54069f88428f'
22-
23-
# Author of this module
24-
Author = 'Microsoft'
25-
26-
# Company or vendor of this module
27-
CompanyName = 'Microsoft'
28-
29-
# Copyright statement for this module
30-
Copyright = 'Microsoft'
31-
32-
# Description of the functionality provided by this module
33-
Description = 'Azure Compute experiments for VM creation'
34-
35-
# Minimum version of the Windows PowerShell engine required by this module
36-
PowerShellVersion = '5.0'
37-
38-
# Name of the Windows PowerShell host required by this module
39-
# PowerShellHostName = ''
40-
41-
# Minimum version of the Windows PowerShell host required by this module
42-
# PowerShellHostVersion = ''
43-
44-
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45-
# DotNetFrameworkVersion = ''
46-
47-
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48-
# CLRVersion = ''
49-
50-
# Processor architecture (None, X86, Amd64) required by this module
51-
# ProcessorArchitecture = ''
52-
53-
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(
55-
@{ ModuleName = "AzureRM.Resources"; ModuleVersion = "4.3.1"; },
56-
@{ ModuleName = "AzureRM.Network"; ModuleVersion = "4.3.1"; },
57-
@{ ModuleName = "AzureRM.Compute"; ModuleVersion = "3.3.1"; }
58-
)
59-
60-
# Assemblies that must be loaded prior to importing this module
61-
# RequiredAssemblies = @()
62-
63-
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
64-
# ScriptsToProcess = @()
65-
66-
# Type files (.ps1xml) to be loaded when importing this module
67-
# TypesToProcess = @()
68-
69-
# Format files (.ps1xml) to be loaded when importing this module
70-
# FormatsToProcess = @()
71-
72-
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
73-
# NestedModules = @()
74-
75-
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
76-
FunctionsToExport = 'New-AzVm'
77-
78-
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
79-
# CmdletsToExport =
80-
81-
# Variables to export from this module
82-
VariablesToExport = '*'
83-
84-
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
85-
AliasesToExport = @()
86-
87-
# DSC resources to export from this module
88-
# DscResourcesToExport = @()
89-
90-
# List of all modules packaged with this module
91-
# ModuleList = @()
92-
93-
# List of all files packaged with this module
94-
# FileList = @()
95-
96-
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
97-
PrivateData = @{
98-
99-
PSData = @{
100-
101-
# Tags applied to this module. These help with module discovery in online galleries.
102-
# Tags = @()
103-
104-
# A URL to the license for this module.
105-
# LicenseUri = ''
106-
107-
# A URL to the main website for this project.
108-
# ProjectUri = ''
109-
110-
# A URL to an icon representing this module.
111-
# IconUri = ''
112-
113-
# ReleaseNotes of this module
114-
# ReleaseNotes = ''
115-
116-
} # End of PSData hashtable
117-
118-
} # End of PrivateData hashtable
119-
120-
# HelpInfo URI of this module
121-
# HelpInfoURI = ''
122-
123-
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
124-
# DefaultCommandPrefix = ''
125-
126-
}
1+
#
2+
# Module manifest for module 'AzureRM.Compute.Experiments'
3+
#
4+
# Generated by: Microsoft
5+
#
6+
# Generated on: 9/1/2017
7+
#
8+
9+
@{
10+
11+
# Script module or binary module file associated with this manifest.
12+
RootModule = ".\AzureRM.Compute.Experiments.psm1"
13+
14+
# Version number of this module.
15+
ModuleVersion = '1.0.19'
16+
17+
# Supported PSEditions
18+
# CompatiblePSEditions = @()
19+
20+
# ID used to uniquely identify this module
21+
GUID = 'b5a94030-df85-43fa-b581-54069f88428f'
22+
23+
# Author of this module
24+
Author = 'Microsoft'
25+
26+
# Company or vendor of this module
27+
CompanyName = 'Microsoft'
28+
29+
# Copyright statement for this module
30+
Copyright = 'Microsoft'
31+
32+
# Description of the functionality provided by this module
33+
Description = 'Azure Compute experiments for VM creation'
34+
35+
# Minimum version of the Windows PowerShell engine required by this module
36+
PowerShellVersion = '5.0'
37+
38+
# Name of the Windows PowerShell host required by this module
39+
# PowerShellHostName = ''
40+
41+
# Minimum version of the Windows PowerShell host required by this module
42+
# PowerShellHostVersion = ''
43+
44+
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45+
# DotNetFrameworkVersion = ''
46+
47+
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48+
# CLRVersion = ''
49+
50+
# Processor architecture (None, X86, Amd64) required by this module
51+
# ProcessorArchitecture = ''
52+
53+
# Modules that must be imported into the global environment prior to importing this module
54+
RequiredModules = @(
55+
@{ ModuleName = "AzureRM.Resources"; ModuleVersion = "4.3.2"; },
56+
@{ ModuleName = "AzureRM.Network"; ModuleVersion = "4.3.2"; },
57+
@{ ModuleName = "AzureRM.Compute"; ModuleVersion = "3.3.2"; }
58+
)
59+
60+
# Assemblies that must be loaded prior to importing this module
61+
# RequiredAssemblies = @()
62+
63+
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
64+
# ScriptsToProcess = @()
65+
66+
# Type files (.ps1xml) to be loaded when importing this module
67+
# TypesToProcess = @()
68+
69+
# Format files (.ps1xml) to be loaded when importing this module
70+
# FormatsToProcess = @()
71+
72+
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
73+
# NestedModules = @()
74+
75+
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
76+
FunctionsToExport = 'New-AzVm'
77+
78+
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
79+
# CmdletsToExport =
80+
81+
# Variables to export from this module
82+
VariablesToExport = '*'
83+
84+
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
85+
AliasesToExport = @()
86+
87+
# DSC resources to export from this module
88+
# DscResourcesToExport = @()
89+
90+
# List of all modules packaged with this module
91+
# ModuleList = @()
92+
93+
# List of all files packaged with this module
94+
# FileList = @()
95+
96+
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
97+
PrivateData = @{
98+
99+
PSData = @{
100+
101+
# Tags applied to this module. These help with module discovery in online galleries.
102+
# Tags = @()
103+
104+
# A URL to the license for this module.
105+
# LicenseUri = ''
106+
107+
# A URL to the main website for this project.
108+
# ProjectUri = ''
109+
110+
# A URL to an icon representing this module.
111+
# IconUri = ''
112+
113+
# ReleaseNotes of this module
114+
# ReleaseNotes = ''
115+
116+
} # End of PSData hashtable
117+
118+
} # End of PrivateData hashtable
119+
120+
# HelpInfo URI of this module
121+
# HelpInfoURI = ''
122+
123+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
124+
# DefaultCommandPrefix = ''
125+
126+
}

0 commit comments

Comments
 (0)