Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
hyonholee committed Oct 16, 2015
2 parents 75ae80d + ac71d7f commit afb2e62
Show file tree
Hide file tree
Showing 152 changed files with 18,800 additions and 234 deletions.
22 changes: 21 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
## 2015.09.03 version 0.9.8
## 2015.10.09 version 1.0 preview
* Azure Resource Manager Management Cmdlets
* New-AzureRmResourceGroup - Removed the template deployment parameters from this cmdlet. Template deployment will now be
handled only through the New-AzureRmResourceGroupDeployment
* Get-AzureRmResource - Will query directly against the Resource Provider. Removed parameters for tags from here. New cmdlets added for querying against the cache as listed below.
* Get-AzureRmResourceGroup - Removed parameters for finding resources through tags. New cmdlet added for handling this
functionality as mentioned below.
* Find-AzureRmResource - Query against the cache.
* Find-AzureRmResourceGroup - Tag parameter added for querying resource group containing specific tags.
* Test-AzureResource - Cmdlet removed. Will be adding a better and reliable way to achieve this scenario which will be guaranteed to work against all Resource providers.
* Test-AzureResourceGroup - Cmdlet removed. Will be adding a better and reliable way to achieve this scenario.
* Get-AzureRmResourceProvider - This cmdlet has been renamed. Earlier it was called Get-AzureProvider. We have changed the output to include locations. Now you can use this to find out which providers and types are available for certain location.
* Cmdlets added for policy
* New-AzureRmPolicyDefinition, Get-AzureRmPolicyDefinition, Set-AzureRMPolicyDefinition, Remove-AzureRmPolicyDefinition
* New-AzureRmPolicyAssignment, Get-AzureRmPolicyAssignment, Set-AzureRmPolicyAssignment, Remove-AzureRmPolicyAssignment
* Consolidated Log cmdlets
* Removed Get-AzureResourceLog, Get-AzureResourceGroupLog, Get-AzureProviderLog
* Added new cmdlet Get-AzureLog which you can use to obtain logs at different scopes like resource group, resource, provider.
* Removed Get-AzureLocation - the functionality is now provided through the Get-AzureRmResourceProvider

## 2015.09.03 version 0.9.8
* Azure Redis Cache cmdlets
* New-AzureRMRedisCache - 'RedisVersion' parameter is deprecated.
* Azure Compute (ARM) Cmdlets
Expand Down
2 changes: 2 additions & 0 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft*Azure*Commands*.dll" />
<DelaySignedAssembliesToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\Microsoft.Azure.Common.Extensions.dll" />
<ScriptsToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\*.ps1" />
<ScriptsToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\*.psm1" />
<ScriptsToSign Include="$(LibrarySourceFolder)\Package\$(Configuration)\**\*.ps1xml" />
</ItemGroup>

<Message Importance="high" Text="$(LibrarySourceFolder)\Package\$(Configuration) does not contains any files to sign. Code sign will skip."
Expand Down
2 changes: 0 additions & 2 deletions setup-powershellget/Setup/ShortcutStartup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ To use Azure Service Management cmdlets please execute the following cmdlet:
Install-Module Azure
"@
Write-Output $welcomeMessage

$VerbosePreference = "Continue"
}
}
catch
Expand Down
2 changes: 1 addition & 1 deletion setup-powershellget/azurecmd.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>

<?define version="0.10.0" ?>
<?define version="1.0.0" ?>
<?define versionedStartMenuFolder="Microsoft Azure" ?>
<?define staleStartMenuFolder="Windows Azure" ?>

Expand Down
60 changes: 60 additions & 0 deletions src/Common/Commands.Common/AzureSubscriptionExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Azure.Common.Authentication.Models;

namespace Microsoft.WindowsAzure.Commands.Common
{
public static class AzureSubscriptionExtensions
{

public static string GetStorageAccountName(this AzureSubscription subscription)
{
if (subscription == null || !subscription.IsPropertySet(AzureSubscription.Property.StorageAccount))
{
return null;
}

var result = subscription.GetProperty(AzureSubscription.Property.StorageAccount);
if (!string.IsNullOrWhiteSpace(result))
{
try
{
var pairs = result.Split(new char[]{';'}, StringSplitOptions.RemoveEmptyEntries);
foreach (var pair in pairs)
{
var sides = pair.Split(new char[] {'='}, 2, StringSplitOptions.RemoveEmptyEntries);
if (string.Equals("AccountName", sides[0].Trim(), StringComparison.OrdinalIgnoreCase))
{
result = sides[1].Trim();
break;
}
}
}
catch
{
// if there are any errors, return the unchanged account name
}
}

return result;
}

}
}
1 change: 1 addition & 0 deletions src/Common/Commands.Common/Commands.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
<Compile Include="AzurePowerShell.cs" />
<Compile Include="AzureRmProfileProvider.cs" />
<Compile Include="AzureSMProfileProvder.cs" />
<Compile Include="AzureSubscriptionExtensions.cs" />
<Compile Include="Constants.cs" />
<Compile Include="ContextExtensions.cs" />
<Compile Include="IProfileProvider.cs" />
Expand Down
1 change: 0 additions & 1 deletion src/Common/Commands.Common/GeneralUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,5 @@ public static void ClearCurrentStorageAccount(bool clearSMContext = false)
}
}
}

}
}
6 changes: 3 additions & 3 deletions src/Common/Storage/Azure.Storage.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@{

# Version number of this module.
ModuleVersion = '0.9.10'
ModuleVersion = '0.10.1'

# ID used to uniquely identify this module
GUID = '00612bca-fa22-401d-a671-9cc48b010e3b'
Expand All @@ -24,7 +24,7 @@ CompanyName = 'Microsoft Corporation'
Copyright = 'Microsoft Corporation. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Microsoft Azure PowerShell - Storage'
Description = 'Microsoft Azure PowerShell - Storage service cmdlets. Manages blobs, queues, tables and files in Microsoft Azure storage accounts'

# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
Expand All @@ -45,7 +45,7 @@ CLRVersion='4.0'
ProcessorArchitecture = 'None'

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.9.10' })
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '0.10.0'})

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = @()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ public class GetAzureStorageContainerCommand : StorageCloudBlobCmdletBase

[Alias("N", "Container")]
[Parameter(Position = 0, HelpMessage = "Container Name",
ValueFromPipelineByPropertyName = true,
ParameterSetName = NameParameterSet)]
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true,
ParameterSetName = NameParameterSet)]
public string Name { get; set; }

[Parameter(HelpMessage = "Container Prefix",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class GetAzureStorageContainerStoredAccessPolicyCommand : StorageCloudBlo
[Alias("N", "Name")]
[Parameter(Position = 0, Mandatory = true,
HelpMessage = "Container name",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
public string Container { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class NewAzureStorageContainerCommand : StorageCloudBlobCmdletBase
{
[Alias("N", "Container")]
[Parameter(Position = 0, Mandatory = true, HelpMessage = "Container name",
ValueFromPipelineByPropertyName = true)]
ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class NewAzureStorageContainerSasTokenCommand : StorageCloudBlobCmdletBas
[Alias("N", "Container")]
[Parameter(Position = 0, Mandatory = true,
HelpMessage = "Container Name",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
public string Name { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class NewAzureStorageContainerStoredAccessPolicyCommand : StorageCloudBlo
[Alias("N", "Name")]
[Parameter(Position = 0, Mandatory = true,
HelpMessage = "Container name",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
public string Container { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public class RemoveAzureStorageContainerCommand : StorageCloudBlobCmdletBase
[Alias("N", "Container")]
[Parameter(Position = 0, Mandatory = true,
HelpMessage = "Container Name",
ValueFromPipelineByPropertyName = true)]
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class SetAzureStorageContainerAclCommand : StorageCloudBlobCmdletBase
{
[Alias("N", "Container")]
[Parameter(Position = 0, Mandatory = true, HelpMessage = "Container Name",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class SetAzureStorageContainerStoredAccessPolicyCommand : StorageCloudBlo
[Alias("N", "Name")]
[Parameter(Position = 0, Mandatory = true,
HelpMessage = "Container name",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
public string Container { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class StorageCloudCmdletBase<T> : AzureDataCmdlet
where T : class
{
[Parameter(HelpMessage = "Azure Storage Context Object",
ValueFromPipelineByPropertyName = true)]
ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)]
public virtual AzureStorageContext Context { get; set; }

[Parameter(HelpMessage = "The server time out for each request in seconds.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File
public abstract class AzureStorageFileCmdletBase : StorageCloudCmdletBase<IStorageFileManagement>
{
[Parameter(
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true,
ParameterSetName = Constants.ShareNameParameterSetName,
HelpMessage = "Azure Storage Context Object")]
[Parameter(
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true,
ParameterSetName = Constants.MatchingPrefixParameterSetName,
HelpMessage = "Azure Storage Context Object")]
[Parameter(
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true,
ParameterSetName = Constants.SpecificParameterSetName,
HelpMessage = "Azure Storage Context Object")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class GetAzureStorageShareStoredAccessPolicy : AzureStorageFileCmdletBase
[Parameter(Position = 0, Mandatory = true,
ParameterSetName = Constants.ShareNameParameterSetName,
HelpMessage = "Share name",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
public string ShareName { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class NewAzureStorageDirectory : AzureStorageFileCmdletBase
[Parameter(
Position = 1,
Mandatory = true,
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Path of the directory to be created.")]
[ValidateNotNullOrEmpty]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,25 @@ public class NewAzureStorageFileSasToken : AzureStorageFileCmdletBase

[Parameter(Position = 0, Mandatory = true,
HelpMessage = "Share Name",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true,
ParameterSetName = NameSasPermissionParameterSet)]
[Parameter(Position = 0, Mandatory = true,
HelpMessage = "Share Name",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true,
ParameterSetName = NameSasPolicyParmeterSet)]
[ValidateNotNullOrEmpty]
public string ShareName { get; set; }

[Parameter(Position = 1, Mandatory = true,
HelpMessage = "Path to the cloud file to generate sas token against.",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true,
ParameterSetName = NameSasPermissionParameterSet)]
[Parameter(Position = 1, Mandatory = true,
HelpMessage = "Path to the cloud file to generate sas token against.",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true,
ParameterSetName = NameSasPolicyParmeterSet)]
[ValidateNotNullOrEmpty]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class NewAzureStorageShare : AzureStorageFileCmdletBase
[Parameter(
Position = 0,
Mandatory = true,
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Name of the file share to be created.")]
[ValidateNotNullOrEmpty]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class NewAzureStorageShareSasToken : AzureStorageFileCmdletBase
[Alias("N", "Name")]
[Parameter(Position = 0, Mandatory = true,
HelpMessage = "Share Name",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
public string ShareName { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class NewAzureStorageShareStoredAccessPolicy : AzureStorageFileCmdletBase
[Parameter(Position = 0, Mandatory = true,
ParameterSetName = Constants.ShareNameParameterSetName,
HelpMessage = "Share name",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
public string ShareName { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public class RemoveAzureStorageDirectory : AzureStorageFileCmdletBase
HelpMessage = "Path to the directory to be removed.")]
[Parameter(
Position = 1,
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true,
ParameterSetName = Constants.DirectoryParameterSetName,
HelpMessage = "Path to the directory to be removed.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class RemoveAzureStorageShare : AzureStorageFileCmdletBase
[Parameter(
Position = 0,
Mandatory = true,
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true,
ParameterSetName = Constants.ShareNameParameterSetName,
HelpMessage = "Name of the file share to be removed.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class SetAzureStorageShareQuota : AzureStorageFileCmdletBase
[Parameter(Position = 0, Mandatory = true,
HelpMessage = "Share name",
ParameterSetName = Constants.ShareNameParameterSetName,
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
public string ShareName { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class SetAzureStorageShareStoredAccessPolicy : AzureStorageFileCmdletBase
[Parameter(Position = 0, Mandatory = true,
ParameterSetName = Constants.ShareNameParameterSetName,
HelpMessage = "Share name",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
public string ShareName { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class GetAzureStorageQueueCommand : StorageQueueBaseCmdlet

[Alias("N", "Queue")]
[Parameter(Position = 0, HelpMessage = "Queue name",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true,
ParameterSetName = NameParameterSet)]
public string Name { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class GetAzureStorageQueueStoredAccessPolicyCommand : StorageQueueBaseCmd
[Alias("N", "Name")]
[Parameter(Position = 0, Mandatory = true,
HelpMessage = "Queue Name",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
public string Queue { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public class NewAzureStorageQueueCommand : StorageQueueBaseCmdlet
{
[Alias("N", "Queue")]
[Parameter(Position = 0, Mandatory = true, HelpMessage = "Queue name",
ValueFromPipelineByPropertyName = true)]
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
public string Name { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class NewAzureStorageQueueSasTokenCommand : StorageQueueBaseCmdlet
[Alias("N", "Queue")]
[Parameter(Position = 0, Mandatory = true,
HelpMessage = "Table Name",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
public string Name { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class NewAzureStorageQueueStoredAccessPolicyCommand : StorageQueueBaseCmd
[Alias("N", "Name")]
[Parameter(Position = 0, Mandatory = true,
HelpMessage = "Queue Name",
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty]
public string Queue { get; set; }
Expand Down
Loading

0 comments on commit afb2e62

Please sign in to comment.