-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInvoke-CloudLab.ps1
54 lines (49 loc) · 1.36 KB
/
Invoke-CloudLab.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<#
.Synopsis
Stand, test and destroy simple cluoud lab.
.DESCRIPTION
Long description
.EXAMPLE
The purpose of this project is the comparison of major cloud providers in regards to administrative ease of use.
.EXAMPLE
Invoke-CloudLab.ps1 -cloud AWS
.NOTES
Assumes clean Window 10 workstation. Requires credential files.
#>
function Invoke-CloudLab
{
[CmdletBinding(SupportsShouldProcess=$true)]
Param
(
# Cloud Platform selection
[Parameter(Mandatory=$true,
Position=0)]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[ValidateSet("AWS", "Azure", "DO")]
[Alias("c")]
[String]$Cloud,
# Credential file path
[parameter(Position=1)]
[ValidateScript({Test-Path $_})]
[AllowEmptyString()]
[String]$CredFile = $null
)
# dot-sourcing scripts
. $PSScriptRoot\AWS\Invoke-AWSLab.ps1
. $PSScriptRoot\Azure\Invoke-AzureLab.ps1
. $PSScriptRoot\DO\Invoke-DOLab.ps1
Switch ($cloud) {
"AWS" {
if ($credfile){Invoke-AWSLab -credfile $Credfile} else {Invoke-AWSLab}
$AWSLab = Import-Clixml $PSScriptroot\AWS\awslab.xml
.$PSScriptRoot\Tests\Invoke-CloudLab.tests.ps1 -VMIPs $AWSLab.IPs -loadbalanceruri $AWSLab.LBAddress
}
"Azure" {
Invoke-AzureLab
}
"DO" {
Invoke-DOLab -credfile $CredFile
}
}
}