forked from fabragaMS/ADPE2E
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- DataLake containers now automatically created by ARM template to speed up lab execution; - Instructions to creatd data lake containers removed from labs; - Lab2 Mapping Data Flow Derived Column Transformation Script added; - Lab5 Event Hub input screenshot updated.
- Loading branch information
Showing
10 changed files
with
263 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Workflow Stop-Start-AzureVM | ||
{ | ||
Param | ||
( | ||
[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()] | ||
[String] | ||
$AzureSubscriptionId, | ||
[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()] | ||
[String] | ||
$ResourceGroupName, | ||
[Parameter(Mandatory=$true)][ValidateSet("Start","Stop")] | ||
[String] | ||
$Action | ||
) | ||
|
||
$credential = Get-AutomationPSCredential -Name 'AzureCredential' | ||
Login-AzureRmAccount -Credential $credential | ||
Select-AzureRmSubscription -SubscriptionId $AzureSubscriptionId | ||
|
||
if($AzureVMList -ne "All") | ||
{ | ||
$AzureVMs = $AzureVMList.Split(",") | ||
[System.Collections.ArrayList]$AzureVMsToHandle = $AzureVMs | ||
} | ||
else | ||
{ | ||
$AzureVMs = (Get-AzureRmVM).Name | ||
[System.Collections.ArrayList]$AzureVMsToHandle = $AzureVMs | ||
|
||
} | ||
|
||
foreach($AzureVM in $AzureVMsToHandle) | ||
{ | ||
if(!(Get-AzureRmVM | ? {$_.Name -eq $AzureVM})) | ||
{ | ||
throw " AzureVM : [$AzureVM] - Does not exist! - Check your inputs " | ||
} | ||
} | ||
|
||
if($Action -eq "Stop") | ||
{ | ||
Write-Output "Stopping VMs"; | ||
foreach -parallel ($AzureVM in $AzureVMsToHandle) | ||
{ | ||
Get-AzureRmVM | ? {$_.Name -eq $AzureVM} | Stop-AzureRmVM -Force | ||
} | ||
} | ||
else | ||
{ | ||
Write-Output "Starting VMs"; | ||
foreach -parallel ($AzureVM in $AzureVMsToHandle) | ||
{ | ||
Get-AzureRmVM | ? {$_.Name -eq $AzureVM} | Start-AzureRmVM | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.