Skip to content

Commit 3c5fe48

Browse files
committed
2 parents 5415967 + fcbce5d commit 3c5fe48

File tree

258 files changed

+45680
-20357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

258 files changed

+45680
-20357
lines changed

ChangeLog.txt

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
2015.05.29 version 0.9.2
2+
* Deprecated Switch-AzureMode
3+
* Profile
4+
* Fixed bug in Get-AzureSubscription and Select-AzureSubscription cmdlets
5+
* Added Automation cmdlets
6+
* Get-AzureAutomationWebhook
7+
* New-AzureAutomationWebhook
8+
* Remove-AzureAutomationWebhook
9+
* Set-AzureAutomationWebhook
10+
* Azure Compute
11+
* Get-AzureVMImage and Get-AzureVMImageDetail are combined (Get-AzureVMImageDetail gives a warning message for future deprecation)
12+
* Get-AzureVMExtensionImage and Get-AzureVMExtensionImageDetail are combined (Get-AzureVMExtensionImageDetail gives a warning message for future deprecation)
13+
* Tags are added in VM resources
14+
* Get-AzureVM now gets resource group name from piping
15+
* -All switch is removed from Get-AzureVM
16+
* Get-AzureVM -Status output is updated
17+
* -Force parameter is added for Remove-AzureAvailabilitySet
18+
* Outputs of New-AzureAvailabilitySet, Get-AzureAvailabilitySet, and Remove-AzureAvailabilitySet are updated
19+
* Azure Key Vault
20+
* Update Set-AzureKeyVaultAccessPolicy and Remove-AzureKeyVaultAccessPolicy cmdlets
21+
* Fixed bugs
22+
* Azure Data Factories
23+
* Base cmdlet type switch to use Profile
24+
* New-AzureDataFactoryEncryptedValue cmdlet supporting M data sources
25+
* Azure Resource Manager
26+
* Fixed bug in Move-AzureResource cmdlet
27+
* Fixed bug in Set-AzureResource cmdlet
28+
129
2015.05.04 version 0.9.1
230
* Azure SQL Database: new support for configuring audit retention.
331
* Azure Automation
@@ -332,7 +360,7 @@
332360
* Set-AzureVMCustomScriptExtension
333361
* Set-AzureVMAccessExtension
334362
* Show 'Regions' property for Get-AzureVMAvailableExtensions cmdlet
335-
* Add 'ResizedSizeInGB' pramater for the following cmdlets
363+
* Add 'ResizedSizeInGB' parameter for the following cmdlets
336364
* Update-AzureDisk
337365
* Set-AzureOSDisk
338366
* Set-AzureDataDisk (DiskName parameter is also added along with ResizedSizeInGB)
@@ -437,7 +465,7 @@
437465
* Compute
438466
* Set-AzureVMImage cmdlets - added IconUri, SmallIconUri, and ShowInGui parameters
439467
* Sql
440-
* Added Sql Servver v12 support to SQL authentication context for SqlAzure cmdlets
468+
* Added Sql Server v12 support to SQL authentication context for SqlAzure cmdlets
441469

442470
2014.11.14 Version 0.8.11
443471
* Profile
@@ -760,7 +788,7 @@
760788
* Remove-AzureVMImageOSDiskConfig
761789
* Set-AzureVMImageDataDiskConfig
762790
* Remove-AzureVMImageDataDiskConfig
763-
* Virtual network improvments
791+
* Virtual network improvements
764792
* Set-AzureVnetGatewayKey
765793
* Azure Automation cmdlets
766794
* Get-AzureAutomationAccount

setup/azurecmd.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
66
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>
77

8-
<?define version="0.9.1" ?>
8+
<?define version="0.9.2" ?>
99
<?define versionedStartMenuFolder="Microsoft Azure" ?>
1010
<?define staleStartMenuFolder="Windows Azure" ?>
1111

setup/azurecmdfiles.wxi

Lines changed: 190 additions & 8 deletions
Large diffs are not rendered by default.

src/Common/Commands.Common/AzurePowerShell.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public class AzurePowerShell
2727

2828
public const string AssemblyCopyright = "Copyright © Microsoft";
2929

30-
public const string AssemblyVersion = "0.9.1";
30+
public const string AssemblyVersion = "0.9.2";
3131

32-
public const string AssemblyFileVersion = "0.9.1";
32+
public const string AssemblyFileVersion = "0.9.2";
3333

3434
public const string ProfileFile = "AzureProfile.json";
3535

src/Common/Commands.Common/Properties/Resources.Designer.cs

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Common/Commands.Common/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,4 +1358,7 @@ use and privacy statement at &lt;url&gt; and (c) agree to sharing my contact inf
13581358
<data name="AzureProfileMustNotBeNull" xml:space="preserve">
13591359
<value>Selected profile must not be null.</value>
13601360
</data>
1361+
<data name="SwitchAzureModeDeprecated" xml:space="preserve">
1362+
<value>The Switch-AzureMode cmdlet is deprecated and will be removed in a future release.</value>
1363+
</data>
13611364
</root>

src/Common/Commands.Profile/SwitchAzureMode.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
using System;
1616
using System.Management.Automation;
17+
using Microsoft.WindowsAzure.Commands.Common.Properties;
1718
using Microsoft.WindowsAzure.Commands.Utilities.Common;
1819
using Microsoft.Azure.Common.Authentication;
1920

@@ -34,6 +35,7 @@ public class SwitchAzureMode : AzurePSCmdlet
3435

3536
public override void ExecuteCmdlet()
3637
{
38+
WriteWarning(Resources.SwitchAzureModeDeprecated);
3739
AzureModule moduleToImport = (AzureModule)Enum.Parse(typeof(AzureModule), Name, false);
3840
AzureModule moduleToRemove = moduleToImport == AzureModule.AzureResourceManager ? AzureModule.AzureServiceManagement : AzureModule.AzureResourceManager;
3941
RemoveAzureModule(FileUtilities.GetModuleName(moduleToRemove), FileUtilities.GetPSModulePathForModule(moduleToRemove));

src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@
203203
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.AutomationTests\TestAutomationSuspendAndResumeJob.json">
204204
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
205205
</None>
206+
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.AzureVMTests\TestGetAzureVM.json">
207+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
208+
</None>
206209
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.SchedulerTests\TestSchedulerEndToEnd.json">
207210
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
208211
</None>
@@ -284,10 +287,10 @@
284287
<Compile Include="Resources\ResourceLocator.cs" />
285288
<Compile Include="Scheduler\SchedulerTests.cs" />
286289
<Compile Include="ServiceBusTests\ServiceBusAuthorizationRuleTests.cs" />
290+
<Compile Include="ServiceManagement\GetVMTests.cs" />
287291
<Compile Include="StorageTests\StorageContainerTest.cs" />
288292
<Compile Include="StorageTests\StorageContextTest.cs" />
289293
<Compile Include="StoreTests\StoreTests.cs" />
290-
<Compile Include="ServiceManagement\VMProvisionScenarioTests.cs" />
291294
<Compile Include="TrafficManagerTests\TrafficManagerTests.cs" />
292295
<Compile Include="WAPackIaaS\CloudService\CmdletTestCloudServiceBase.cs" />
293296
<Compile Include="WAPackIaaS\CloudService\GetWAPackCloudServiceTests.cs" />
@@ -408,7 +411,7 @@
408411
<None Include="Resources\CloudService\Cache\mc.tgz">
409412
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
410413
</None>
411-
<None Include="Resources\ServiceManagement\VMProvisionTests.ps1">
414+
<None Include="Resources\ServiceManagement\AzureVMTests.ps1">
412415
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
413416
</None>
414417
<None Include="Resources\ServiceManagement\Common.ps1">

src/Common/Commands.ScenarioTest/Resources/ServiceManagement/VMProvisionTests.ps1 renamed to src/Common/Commands.ScenarioTest/Resources/ServiceManagement/AzureVMTests.ps1

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,30 @@
1818
.SYNOPSIS
1919
Tests Create-AzureVM with valid information.
2020
#>
21-
function Test-CreateWindowsAzureQuickVM
21+
function Test-GetAzureVM
2222
{
2323
# Setup
24+
2425
$location = Get-DefaultLocation
26+
$imgName = Get-DefaultImage $location
27+
28+
29+
$storageName = getAssetName
30+
New-AzureStorageAccount -StorageAccountName $storageName -Location $location
31+
32+
Set-CurrentStorageAccountName $storageName
33+
34+
$vmName = "vm1"
35+
$svcName = Get-CloudServiceName
2536

2637
# Test
27-
New-AzureQuickVM -Windows -ImageName $imageName -Name $newAzureQuickVMName -ServiceName $newAzureQuickVMSvcName -Password "p@ssw0rd" -Location $location
28-
}
38+
New-AzureService -ServiceName $svcName -Location $location
39+
New-AzureQuickVM -Windows -ImageName $imgName -Name $vmName -ServiceName $svcName -AdminUsername "pstestuser" -Password "p@ssw0rd"
40+
41+
Get-AzureVM -ServiceName $svcName -Name $vmName
42+
43+
44+
# Cleanup
45+
Cleanup-CloudService $svcName
46+
}
47+

src/Common/Commands.ScenarioTest/Resources/ServiceManagement/Common.ps1

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,79 @@
1212
# limitations under the License.
1313
# ----------------------------------------------------------------------------------
1414

15+
1516
<#
1617
.SYNOPSIS
17-
Sets
18+
Sets the default storage account
1819
#>
1920
function Set-CurrentStorageAccountName
2021
{
21-
Get-AzureSubscription -Default | Set-AzureSubscription -CurrentStorageAccountName ""
22-
}
22+
param([string] $storageAccountName)
23+
$currentSubscription = Get-AzureSubscription -Current
24+
25+
Set-AzureSubscription -SubscriptionId $currentSubscription.SubscriptionId -CurrentStorageAccountName $storageAccountName
26+
}
27+
28+
<#
29+
.SYNOPSIS
30+
Gets the default location
31+
#>
32+
function Get-DefaultLocation
33+
{
34+
return (Get-AzureLocation)[0].Name
35+
}
36+
37+
<#
38+
.SYNOPSIS
39+
Gets the default image
40+
#>
41+
function Get-DefaultImage
42+
{
43+
param([string] $loc)
44+
return (Get-AzureVMImage | where {$_.OS -eq "Windows"} | where {$_.Location.Contains($loc)})[0].ImageName
45+
}
46+
47+
48+
<#
49+
.SYNOPSIS
50+
Gets valid and available cloud service name.
51+
#>
52+
function Get-CloudServiceName
53+
{
54+
return getAssetName
55+
}
56+
57+
<#
58+
.SYNOPSIS
59+
Cleanup cloud service
60+
#>
61+
function Cleanup-CloudService
62+
{
63+
param([string] $name)
64+
try
65+
{
66+
Remove-AzureService -ServiceName $name -Force
67+
}
68+
catch
69+
{
70+
Write-Warning "Cannot Remove the Cloud Service"
71+
}
72+
}
73+
74+
<#
75+
.SYNOPSIS
76+
Cleanup storage
77+
#>
78+
function Cleanup-Storage
79+
{
80+
param([string] $name)
81+
Remove-AzureStorageAccount -StorageAccountName $name
82+
try
83+
{
84+
Remove-AzureStorageAccount -StorageAccountName $name
85+
}
86+
catch
87+
{
88+
Write-Warning "Cannot Remove the Storage Account"
89+
}
90+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Common.Authentication;
16+
using Microsoft.Azure.Test;
17+
using System.Collections.Generic;
18+
using System.IO;
19+
using System.Linq;
20+
using Xunit;
21+
22+
namespace Microsoft.WindowsAzure.Commands.ScenarioTest
23+
{
24+
public class AzureVMTests
25+
{
26+
private EnvironmentSetupHelper helper = new EnvironmentSetupHelper();
27+
28+
#region Get-AzureVM Scenario Tests
29+
30+
[Fact]
31+
[Trait(Category.Service, Category.ServiceManagement)]
32+
[Trait(Category.AcceptanceType, Category.LiveOnly)]
33+
[Trait(Category.AcceptanceType, Category.BVT)]
34+
public void TestGetAzureVM()
35+
{
36+
this.RunPowerShellTest("Test-GetAzureVM");
37+
}
38+
#endregion
39+
40+
protected void SetupManagementClients()
41+
{
42+
helper.SetupSomeOfManagementClients();
43+
}
44+
45+
protected void RunPowerShellTest(params string[] scripts)
46+
{
47+
using (UndoContext context = UndoContext.Current)
48+
{
49+
context.Start(TestUtilities.GetCallingClass(1), TestUtilities.GetCurrentMethodName(2));
50+
51+
SetupManagementClients();
52+
53+
List<string> modules = Directory.GetFiles("Resources\\ServiceManagement", "*.ps1").ToList();
54+
modules.Add("Common.ps1");
55+
56+
helper.SetupEnvironment(AzureModule.AzureServiceManagement);
57+
helper.SetupModules(AzureModule.AzureServiceManagement, modules.ToArray());
58+
59+
helper.RunPowerShellTest(scripts);
60+
}
61+
}
62+
}
63+
}

0 commit comments

Comments
 (0)