diff --git a/AzurePowershell.Test.targets b/AzurePowershell.Test.targets
index 1430a7f75abc..93506ce9c63c 100644
--- a/AzurePowershell.Test.targets
+++ b/AzurePowershell.Test.targets
@@ -45,10 +45,10 @@
-
+
-
-
+
+
@@ -60,12 +60,12 @@
-
-
-
-
+
+
+
+
-
+
diff --git a/build.proj b/build.proj
index 9ec09e76f610..cd4fbdbd0a3a 100644
--- a/build.proj
+++ b/build.proj
@@ -43,7 +43,7 @@
Targets="Clean"
Properties="$(ReleaseBuildConfig)"
ContinueOnError="false" />
-
+ ContinueOnError="false" />
-
+ ContinueOnError="false" />
@@ -199,12 +199,12 @@
Properties="$(ReleaseBuildConfig)"
BuildInParallel="$(BuildInParallel)"
ContinueOnError="false" />
-
+ ContinueOnError="false" />
@@ -216,12 +216,12 @@
Properties="$(DebugBuildConfig)"
BuildInParallel="$(BuildInParallel)"
ContinueOnError="false" />
-
+ ContinueOnError="false" />
diff --git a/src/Common/Commands.Common.Test/Commands.Common.Test.csproj b/src/Common/Commands.Common.Test/Commands.Common.Test.csproj
index 1a4e276a8111..6a2767629833 100644
--- a/src/Common/Commands.Common.Test/Commands.Common.Test.csproj
+++ b/src/Common/Commands.Common.Test/Commands.Common.Test.csproj
@@ -190,7 +190,6 @@
-
True
@@ -209,10 +208,6 @@
{5ee72c53-1720-4309-b54b-5fb79703195f}
Commands.Common
-
- {c60342b1-47d3-4a0e-8081-9b97ce60b7af}
- Commands.Profile
-
{c1bda476-a5cc-4394-914d-48b0ec31a710}
Commands.ScenarioTests.Common
diff --git a/src/Common/Commands.Profile/Commands.Profile.csproj b/src/Common/Commands.Profile/Commands.Profile.csproj
index a5b345aca0db..16be9cb12d53 100644
--- a/src/Common/Commands.Profile/Commands.Profile.csproj
+++ b/src/Common/Commands.Profile/Commands.Profile.csproj
@@ -19,7 +19,7 @@
true
full
false
- bin\Debug\
+ ..\..\Package\Debug\ServiceManagement\Azure\Services
DEBUG;TRACE
prompt
4
@@ -28,7 +28,7 @@
false
- bin\Release\
+ ..\..\Package\Release\ServiceManagement\Azure\Services
TRACE;SIGN
true
pdbonly
@@ -60,10 +60,6 @@
..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll
-
- False
- ..\..\packages\Microsoft.Azure.Management.Resources.2.18.7-preview\lib\net40\Microsoft.Azure.ResourceManager.dll
-
@@ -161,7 +157,9 @@
Always
-
+
+ Designer
+
diff --git a/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj b/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj
index e0321b7005a8..17a57466968c 100644
--- a/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj
+++ b/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj
@@ -130,9 +130,7 @@
-
- Mocks\MockCommandRuntime.cs
-
+
diff --git a/src/Common/Commands.Common.Test/Mocks/MockCommandRuntime.cs b/src/Common/Commands.ScenarioTests.Common/Mocks/MockCommandRuntime.cs
similarity index 100%
rename from src/Common/Commands.Common.Test/Mocks/MockCommandRuntime.cs
rename to src/Common/Commands.ScenarioTests.Common/Mocks/MockCommandRuntime.cs
diff --git a/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj b/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj
index a082b523d01d..dce4b1fee69d 100644
--- a/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj
+++ b/src/ResourceManager/Compute/Commands.Compute/Commands.Compute.csproj
@@ -188,18 +188,12 @@
Extension\DSC\DscExtensionSettingsSerializer.cs
-
- Extension\DSC\GetDscResourceException.cs
-
Extension\DSC\ConfigurationParseResult.cs
Extension\DSC\ConfigurationParsingHelper.cs
-
- Extension\DSC\DscExtensionPublishCmdletCommonBase.cs
-
@@ -219,6 +213,8 @@
+
+
diff --git a/src/ResourceManager/Compute/Commands.Compute/Extension/DSC/DscExtensionPublishCmdletCommonBase.cs b/src/ResourceManager/Compute/Commands.Compute/Extension/DSC/DscExtensionPublishCmdletCommonBase.cs
new file mode 100644
index 000000000000..24a5bdf098a1
--- /dev/null
+++ b/src/ResourceManager/Compute/Commands.Compute/Extension/DSC/DscExtensionPublishCmdletCommonBase.cs
@@ -0,0 +1,575 @@
+using Microsoft.WindowsAzure.Commands.Common.Extensions.DSC.Exceptions;
+using Microsoft.WindowsAzure.Commands.Utilities.Common;
+using Microsoft.WindowsAzure.Storage;
+using Microsoft.WindowsAzure.Storage.Auth;
+using Microsoft.WindowsAzure.Storage.Blob;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.IO.Compression;
+using System.Linq;
+using System.Management.Automation;
+using Newtonsoft.Json;
+
+
+namespace Microsoft.WindowsAzure.Commands.Common.Extensions.DSC.Publish
+{
+ public class DscExtensionPublishCmdletCommonBase : Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet
+ {
+ //Publish
+ private const string CreateArchiveParameterSetName = "CreateArchive";
+ private const string UploadArchiveParameterSetName = "UploadArchive";
+ private readonly List _temporaryFilesToDelete = new List();
+ private readonly List _temporaryDirectoriesToDelete = new List();
+
+ public void ValidatePsVersion()
+ {
+ using (System.Management.Automation.PowerShell powershell = System.Management.Automation.PowerShell.Create())
+ {
+ powershell.AddScript("$PSVersionTable.PSVersion.Major");
+ int major = powershell.Invoke().FirstOrDefault();
+ if (major < DscExtensionCmdletConstants.MinMajorPowerShellVersion)
+ {
+ ThrowTerminatingError(
+ new ErrorRecord(
+ new InvalidOperationException(
+ string.Format(
+ CultureInfo.CurrentUICulture,
+ Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionRequiredPsVersion,
+ DscExtensionCmdletConstants.MinMajorPowerShellVersion,
+ major)),
+ "InvalidPowerShellVersion",
+ ErrorCategory.InvalidOperation,
+ null));
+ }
+ }
+ }
+
+ public void ValidateConfigurationPath(String configurationPath, String paramaterSetName)
+ {
+ if (!File.Exists(configurationPath))
+ {
+ ThrowInvalidArgumentError(
+ Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionUploadArchiveConfigFileNotExist,
+ configurationPath);
+ }
+
+ var configurationFileExtension = Path.GetExtension(configurationPath);
+
+ if (paramaterSetName == UploadArchiveParameterSetName)
+ {
+ if (!DscExtensionCmdletConstants.UploadArchiveAllowedFileExtensions.Contains(Path.GetExtension(configurationFileExtension)))
+ {
+ ThrowInvalidArgumentError(Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension, configurationPath);
+ }
+ }
+ else if (paramaterSetName == CreateArchiveParameterSetName)
+ {
+ if (!DscExtensionCmdletConstants.CreateArchiveAllowedFileExtensions.Contains(Path.GetExtension(configurationFileExtension)))
+ {
+ ThrowInvalidArgumentError(Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension, configurationPath);
+ }
+ }
+ }
+
+ public void ValidateConfigurationDataPath(String configurationDataPath)
+ {
+ if (!File.Exists(configurationDataPath))
+ {
+ ThrowInvalidArgumentError(
+ Microsoft.Azure.Commands.Compute.Properties.Resources.AzureVMDscCannotFindConfigurationDataFile,
+ configurationDataPath);
+ }
+ if (string.Compare(
+ Path.GetExtension(configurationDataPath),
+ ".psd1",
+ StringComparison.InvariantCultureIgnoreCase) != 0)
+ {
+ ThrowInvalidArgumentError(Microsoft.Azure.Commands.Compute.Properties.Resources.AzureVMDscInvalidConfigurationDataFile);
+ }
+ }
+
+ public string CreateConfigurationArchive(
+ String configurationPath,
+ String configurationDataPath,
+ String[] additionalPath,
+ String configurationArchivePath,
+ Boolean force,
+ Boolean skipDependencyDetection,
+ String parameterSetName)
+ {
+ var metadata = new Dictionary();
+ // Create a temporary directory for uploaded zip file
+ var tempZipFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
+ WriteVerbose(String.Format(
+ CultureInfo.CurrentUICulture,
+ Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionTempFolderVerbose,
+ tempZipFolder));
+ Directory.CreateDirectory(tempZipFolder);
+ _temporaryDirectoriesToDelete.Add(tempZipFolder);
+
+ // Copy Configuration
+ var configurationName = Path.GetFileName(configurationPath);
+ var configurationDestination = Path.Combine(tempZipFolder, configurationName);
+ CopyFileToZipFolder(configurationPath, configurationDestination);
+
+ //copy configuration data if available
+ if (configurationDataPath != null)
+ {
+ var configurationDataName = Path.GetFileName(configurationDataPath);
+ var configurationDataDestination = Path.Combine(tempZipFolder, configurationDataName);
+ metadata.Add("ConfigurationData", configurationDataName);
+ CopyFileToZipFolder(configurationDataPath, configurationDataDestination);
+ }
+
+ //copy additional content if available
+ if (additionalPath != null && additionalPath.Length > 0)
+ {
+ var additionalContentMetadata = new List();
+ foreach (var contentPath in additionalPath)
+ {
+ CopyAdditionalContent(contentPath, tempZipFolder, additionalContentMetadata);
+ }
+ metadata.Add("AdditionalContent", additionalContentMetadata);
+ }
+
+ //Copy required modules when -SkipDependencyDetection switch is not present
+ if (!skipDependencyDetection)
+ {
+ var metadataModules = CopyRequiredModules(configurationPath, tempZipFolder);
+ if (metadataModules != null)
+ {
+ metadata.Add("Modules", metadataModules);
+ }
+ }
+
+ //copy metadata info
+
+ var metadataJson = JsonConvert.SerializeObject(metadata);
+ const string metadataFileName = "dscmetadata.json";
+ var metadataDestPath = Path.Combine(tempZipFolder, metadataFileName);
+ File.WriteAllText(metadataDestPath, metadataJson);
+
+ //
+ // Zip the directory
+ //
+ string archive;
+ if (parameterSetName == CreateArchiveParameterSetName)
+ {
+ archive = configurationArchivePath;
+
+ if (!force && File.Exists(archive))
+ {
+ ThrowTerminatingError(
+ new ErrorRecord(
+ new UnauthorizedAccessException(string.Format(CultureInfo.CurrentUICulture, Microsoft.Azure.Commands.Compute.Properties.Resources.AzureVMDscArchiveAlreadyExists, archive)),
+ "FileAlreadyExists",
+ ErrorCategory.PermissionDenied,
+ null));
+ }
+ }
+ else
+ {
+ string tempArchiveFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
+ WriteVerbose(String.Format(CultureInfo.CurrentUICulture, Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionTempFolderVerbose, tempArchiveFolder));
+ Directory.CreateDirectory(tempArchiveFolder);
+ _temporaryDirectoriesToDelete.Add(tempArchiveFolder);
+ archive = Path.Combine(tempArchiveFolder, configurationName + DscExtensionCmdletConstants.ZipFileExtension);
+ _temporaryFilesToDelete.Add(archive);
+ }
+
+ if (File.Exists(archive))
+ {
+ File.Delete(archive);
+ }
+
+ ZipFile.CreateFromDirectory(tempZipFolder, archive);
+
+ return archive;
+ }
+
+ ///
+ /// Publish the configuration and its modules
+ ///
+ public void PublishConfiguration(
+ String configurationPath,
+ String configurationDataPath,
+ String[] additionalPath,
+ String outputArchivePath,
+ String storageEndpointSuffix,
+ String containerName,
+ String parameterSetName,
+ Boolean force,
+ Boolean skipDependencyDetection,
+ StorageCredentials storageCredentials,
+ Boolean passThru = true)
+ {
+ if (parameterSetName == CreateArchiveParameterSetName)
+ {
+ ConfirmAction(
+ true,
+ string.Empty,
+ Microsoft.Azure.Commands.Compute.Properties.Resources.AzureVMDscCreateArchiveAction,
+ outputArchivePath, () => CreateConfigurationArchive(
+ configurationPath,
+ configurationDataPath,
+ additionalPath,
+ outputArchivePath,
+ force,
+ skipDependencyDetection,
+ parameterSetName));
+ }
+ else
+ {
+ var archivePath = string.Compare(
+ Path.GetExtension(configurationPath),
+ DscExtensionCmdletConstants.ZipFileExtension,
+ StringComparison.OrdinalIgnoreCase) == 0
+ ? configurationPath
+ : CreateConfigurationArchive(
+ configurationPath,
+ configurationDataPath,
+ additionalPath,
+ outputArchivePath,
+ force,
+ skipDependencyDetection,
+ parameterSetName);
+
+ UploadConfigurationArchive(storageCredentials, storageEndpointSuffix, containerName, archivePath, force, passThru);
+ }
+ }
+
+ private List CopyRequiredModules(String configurationPath, String tempZipFolder)
+ {
+ WriteVerbose(
+ String.Format(
+ CultureInfo.CurrentUICulture,
+ Microsoft.Azure.Commands.Compute.Properties.Resources.AzureVMDscParsingConfiguration,
+ configurationPath));
+
+ var requiredModules = GetRequiredModules(configurationPath);
+ var metadataModules = new List();
+
+ foreach (var module in requiredModules)
+ {
+ metadataModules.Add(module.Key);
+ using (System.Management.Automation.PowerShell powershell = System.Management.Automation.PowerShell.Create())
+ {
+ // Wrapping script in a function to prevent script injection via $module variable.
+ powershell.AddScript(
+ @"function Copy-Module([string]$moduleName, [string]$moduleVersion, [string]$tempZipFolder)
+ {
+ if([String]::IsNullOrEmpty($moduleVersion))
+ {
+ $module = Get-Module -List -Name $moduleName
+ }
+ else
+ {
+ $module = (Get-Module -List -Name $moduleName) | Where-Object{$_.Version -eq $moduleVersion}
+ }
+
+ $moduleFolder = Split-Path $module.Path
+ Copy-Item -Recurse -Path $moduleFolder -Destination ""$tempZipFolder\$($module.Name)""
+ }"
+ );
+ powershell.Invoke();
+ powershell.Commands.Clear();
+ powershell.AddCommand("Copy-Module")
+ .AddParameter("moduleName", module.Key)
+ .AddParameter("moduleVersion", module.Value)
+ .AddParameter("tempZipFolder", tempZipFolder);
+ WriteVerbose(String.Format(
+ CultureInfo.CurrentUICulture,
+ Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionCopyModuleVerbose,
+ module,
+ tempZipFolder));
+ powershell.Invoke();
+ }
+ }
+
+ return metadataModules;
+ }
+
+ private void CopyAdditionalContent(String additionalPath, String tempZipFolder, List additionalContentMetadata)
+ {
+ try
+ {
+ if (PathIsAFile(additionalPath))
+ {
+ var additionalFileName = Path.GetFileName(additionalPath);
+ var additionalFileDestination = Path.Combine(tempZipFolder, additionalFileName);
+ additionalContentMetadata.Add(additionalFileName);
+ CopyFileToZipFolder(additionalPath, additionalFileDestination);
+ }
+ else
+ {
+ var dir = new DirectoryInfo(additionalPath);
+ if (!dir.Exists)
+ {
+ ThrowInvalidArgumentError(
+ Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionDirectoryNotExist,
+ dir);
+ }
+
+ var dirName = dir.Name;
+ additionalContentMetadata.Add(dirName);
+ var dirDestination = Path.Combine(tempZipFolder, dirName);
+
+ CopyDirectory(dirDestination, dir);
+ }
+ }
+ catch (Exception)
+ {
+ ThrowInvalidArgumentError(
+ Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionAdditionalContentPathNotExist,
+ additionalPath);
+ }
+ }
+
+ private void CopyDirectory(String destDirPath, DirectoryInfo dir)
+ {
+ //if the destination directory does not exist create it
+ if (!Directory.Exists(destDirPath))
+ {
+ Directory.CreateDirectory(destDirPath);
+ }
+
+ //get the files in the directory and copy them to the tempzipfolder location
+ var files = dir.GetFiles();
+ foreach (var file in files)
+ {
+ var temppath = Path.Combine(destDirPath, file.Name);
+ file.CopyTo(temppath, true);
+ }
+
+ //copy subdirectories
+ var dirs = dir.GetDirectories();
+ foreach (var subdir in dirs)
+ {
+ var temppath = Path.Combine(destDirPath, subdir.Name);
+ CopyDirectory(temppath, subdir);
+ }
+ }
+
+ private Dictionary GetRequiredModules(String configurationPath)
+ {
+ ConfigurationParseResult parseResult = null;
+ try
+ {
+ parseResult = ConfigurationParsingHelper.ParseConfiguration(configurationPath);
+ }
+ catch (GetDscResourceException e)
+ {
+ ThrowTerminatingError(
+ new ErrorRecord(e, "CannotAccessDscResource", ErrorCategory.PermissionDenied, null));
+ }
+
+ if (parseResult.Errors.Any())
+ {
+ ThrowTerminatingError(
+ new ErrorRecord(
+ new ParseException(
+ String.Format(
+ CultureInfo.CurrentUICulture,
+ Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionStorageParserErrors,
+ configurationPath,
+ String.Join("\n", parseResult.Errors.Select(error => error.ToString())))),
+ "DscConfigurationParseError",
+ ErrorCategory.ParserError,
+ null));
+ }
+
+ var requiredModules = parseResult.RequiredModules;
+ //Since LCM always uses the latest module there is no need to copy PSDesiredStateConfiguration
+ if (requiredModules.ContainsKey("PSDesiredStateConfiguration"))
+ {
+ requiredModules.Remove("PSDesiredStateConfiguration");
+ }
+
+ WriteVerbose(String.Format(
+ CultureInfo.CurrentUICulture,
+ Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionRequiredModulesVerbose,
+ String.Join(", ", requiredModules)));
+
+ return requiredModules;
+ }
+
+ private void UploadConfigurationArchive(
+ StorageCredentials storageCredentials,
+ String storageEndpointSuffix,
+ String containerName,
+ String archivePath,
+ Boolean force,
+ Boolean passThru)
+ {
+ CloudBlockBlob modulesBlob =
+ GetBlobReference(storageCredentials, storageEndpointSuffix, containerName, archivePath);
+
+ ConfirmAction(
+ true,
+ string.Empty,
+ string.Format(CultureInfo.CurrentUICulture, Microsoft.Azure.Commands.Compute.Properties.Resources.AzureVMDscUploadToBlobStorageAction, archivePath),
+ modulesBlob.Uri.AbsoluteUri, () =>
+ {
+ if (!force && modulesBlob.Exists())
+ {
+ ThrowTerminatingError(
+ new ErrorRecord(
+ new UnauthorizedAccessException(
+ string.Format(
+ CultureInfo.CurrentUICulture,
+ Microsoft.Azure.Commands.Compute.Properties.Resources.AzureVMDscStorageBlobAlreadyExists, modulesBlob.Uri.AbsoluteUri)),
+ "StorageBlobAlreadyExists",
+ ErrorCategory.PermissionDenied,
+ null));
+ }
+
+ modulesBlob.UploadFromFile(archivePath, FileMode.Open);
+
+ WriteVerbose(string.Format(
+ CultureInfo.CurrentUICulture,
+ Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionArchiveUploadedMessage, modulesBlob.Uri.AbsoluteUri));
+
+ if (passThru)
+ {
+ WriteObject(modulesBlob.Uri.AbsoluteUri);
+ }
+ });
+ }
+
+ private void CopyFileToZipFolder(String source, string destination)
+ {
+ WriteVerbose(String.Format(
+ CultureInfo.CurrentUICulture,
+ Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionCopyFileVerbose,
+ source,
+ destination));
+ File.Copy(source, destination);
+ }
+
+ private Boolean PathIsAFile(String path)
+ {
+ var attributes = File.GetAttributes(path);
+ return !attributes.HasFlag(FileAttributes.Directory);
+ }
+
+ public void DeleteTemporaryFiles()
+ {
+ foreach (var file in _temporaryFilesToDelete)
+ {
+ try
+ {
+ DeleteFile(file);
+ WriteVerbose(string.Format(CultureInfo.CurrentUICulture, Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionDeletedFileMessage, file));
+ }
+ catch (Exception e)
+ {
+ WriteVerbose(string.Format(CultureInfo.CurrentUICulture, Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionDeleteErrorMessage, file, e.Message));
+ }
+ }
+ foreach (var directory in _temporaryDirectoriesToDelete)
+ {
+ try
+ {
+ DeleteDirectory(directory);
+ WriteVerbose(string.Format(CultureInfo.CurrentUICulture, Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionDeletedFileMessage, directory));
+ }
+ catch (Exception e)
+ {
+ WriteVerbose(string.Format(CultureInfo.CurrentUICulture, Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionDeleteErrorMessage, directory, e.Message));
+ }
+ }
+ }
+
+ private CloudBlockBlob GetBlobReference(
+ StorageCredentials storageCredentials, String storageEndpointSuffix, String containerName, String archivePath)
+ {
+ var storageAccount = new CloudStorageAccount(storageCredentials, storageEndpointSuffix, true);
+ var blobClient = storageAccount.CreateCloudBlobClient();
+
+ CloudBlobContainer containerReference = blobClient.GetContainerReference(containerName);
+ containerReference.CreateIfNotExists();
+
+ var blobName = Path.GetFileName(archivePath);
+
+ return containerReference.GetBlockBlobReference(blobName);
+ }
+
+ protected void ThrowInvalidArgumentError(String format, params object[] args)
+ {
+ ThrowTerminatingError(
+ new ErrorRecord(
+ new ArgumentException(string.Format(CultureInfo.CurrentUICulture, format, args)),
+ "InvalidArgument",
+ ErrorCategory.InvalidArgument,
+ null));
+ }
+
+ private static void DeleteFile(string path)
+ {
+ try
+ {
+ File.Delete(path);
+ }
+ catch (UnauthorizedAccessException)
+ {
+ // the exception may have occurred due to a read-only file
+ DeleteReadOnlyFile(path);
+ }
+ }
+
+ ///
+ /// Turns off the ReadOnly attribute from the given file and then attempts to delete it
+ ///
+ private static void DeleteReadOnlyFile(string path)
+ {
+ var attributes = File.GetAttributes(path);
+
+ if ((attributes & FileAttributes.ReadOnly) != 0)
+ {
+ File.SetAttributes(path, attributes & ~FileAttributes.ReadOnly);
+ }
+
+ File.Delete(path);
+ }
+
+ private static void DeleteDirectory(string path)
+ {
+ try
+ {
+ Directory.Delete(path, true);
+ }
+ catch (UnauthorizedAccessException)
+ {
+ // the exception may have occurred due to a read-only file or directory
+ DeleteReadOnlyDirectory(path);
+ }
+ }
+
+ ///
+ /// Recursively turns off the ReadOnly attribute from the given directory and then attemps to delete it
+ ///
+ private static void DeleteReadOnlyDirectory(string path)
+ {
+ var directory = new DirectoryInfo(path);
+
+ foreach (var child in directory.GetDirectories())
+ {
+ DeleteReadOnlyDirectory(child.FullName);
+ }
+
+ foreach (var child in directory.GetFiles())
+ {
+ DeleteReadOnlyFile(child.FullName);
+ }
+
+ if ((directory.Attributes & FileAttributes.ReadOnly) != 0)
+ {
+ directory.Attributes &= ~FileAttributes.ReadOnly;
+ }
+
+ directory.Delete();
+ }
+ }
+}
diff --git a/src/ResourceManager/Compute/Commands.Compute/Extension/DSC/GetDscResourceException.cs b/src/ResourceManager/Compute/Commands.Compute/Extension/DSC/GetDscResourceException.cs
new file mode 100644
index 000000000000..76472a78af0a
--- /dev/null
+++ b/src/ResourceManager/Compute/Commands.Compute/Extension/DSC/GetDscResourceException.cs
@@ -0,0 +1,28 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Globalization;
+
+
+namespace Microsoft.WindowsAzure.Commands.Common.Extensions.DSC.Exceptions
+{
+ [Serializable]
+ public class GetDscResourceException : UnauthorizedAccessException
+ {
+ public GetDscResourceException(string resourceName, Exception e) :
+ base(String.Format(CultureInfo.CurrentUICulture, Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionGetDscResourceFailed, resourceName), e)
+ { }
+ }
+}
diff --git a/src/ServiceManagement.sln b/src/ServiceManagement.sln
index 3e2cf1aafced..3655651d40cb 100644
--- a/src/ServiceManagement.sln
+++ b/src/ServiceManagement.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.30723.0
+# Visual Studio 14
+VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8531411A-0137-4E27-9C5E-49E07C245048}"
ProjectSection(SolutionItems) = preProject
@@ -74,15 +74,37 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ManagedCache", "Se
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ManagedCache.Test", "ServiceManagement\ManagedCache\Commands.ManagedCache.Test\Commands.ManagedCache.Test.csproj", "{374D4000-DEDE-4995-9B63-E3B9FE0C4D29}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "Common\Commands.Profile\Commands.Profile.csproj", "{C60342B1-47D3-4A0E-8081-9B97CE60B7AF}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.TrafficManager.Test", "ServiceManagement\TrafficManager\Commands.TrafficManager.Test\Commands.TrafficManager.Test.csproj", "{84F99CBD-5B86-4428-B263-135B2F67F512}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.HDInsight", "ServiceManagement\HDInsight\Commands.HDInsight\Commands.HDInsight.csproj", "{137D404A-865A-43DB-930C-6DA67DA048DF}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.HDInsight.Test", "ServiceManagement\HDInsight\Commands.HDInsight.Test\Commands.HDInsight.Test.csproj", "{7E8D2555-2DDD-4757-974F-D5FFD0647671}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Network", "ServiceManagement\Network\Commands.Network\Commands.Network.csproj", "{40FEE0BB-FD45-4EFC-85BC-0D602A6892C4}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Automation", "ServiceManagement\Automation\Commands.Automation\Commands.Automation.csproj", "{47CD7E95-5330-4384-ABCE-2C267C57085C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Automation.Test", "ServiceManagement\Automation\Commands.Automation.Test\Commands.Automation.Test.csproj", "{127D0D51-FDEA-4E1A-8CD8-34DEB5C2F7F6}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HDInsight", "ServiceManagement\HDInsight\Commands.HDInsight\HDInsight.csproj", "{137D404A-865A-43DB-930C-6DA67DA048DF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.Network", "ServiceManagement\Network\Commands.Network\Commands.ServiceManagement.Network.csproj", "{40FEE0BB-FD45-4EFC-85BC-0D602A6892C4}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.Network.Test", "ServiceManagement\Network\Commands.Network.Test\Commands.ServiceManagement.Network.Test.csproj", "{FDB897BD-FCB4-44A1-8D66-AC99F22EC737}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RecoveryServices", "ServiceManagement\RecoveryServices\Commands.RecoveryServices\Commands.RecoveryServices.csproj", "{98B10548-DF97-4FB1-8D82-2A12945D4F21}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RecoveryServices.Test", "ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\Commands.RecoveryServices.Test.csproj", "{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RemoteApp", "ServiceManagement\RemoteApp\Commands.RemoteApp\Commands.RemoteApp.csproj", "{492D2AF2-950B-4F2E-8079-8794305313FD}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RemoteApp.Test", "ServiceManagement\RemoteApp\Commands.RemoteApp.Test\Commands.RemoteApp.Test.csproj", "{CA82D500-1940-4068-A076-D7A8AD459FB0}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.StorSimple", "ServiceManagement\StorSimple\Commands.StorSimple\Commands.StorSimple.csproj", "{11524D98-6C40-4091-A8E1-86463FEE607C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Common", "Common\Commands.ScenarioTests.Common\Commands.ScenarioTests.Common.csproj", "{C1BDA476-A5CC-4394-914D-48B0EC31A710}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ResourceManager.Common", "Common\Commands.ResourceManager.Common\Commands.ResourceManager.Common.csproj", "{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "Common\Commands.Profile\Commands.Profile.csproj", "{C60342B1-47D3-4A0E-8081-9B97CE60B7AF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.StorSimple.Test", "ServiceManagement\StorSimple\Commands.StorSimple.Test\Commands.StorSimple.Test.csproj", "{0FA676D5-1349-4086-B33F-65EC2CB7DA41}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -194,26 +216,70 @@ Global
{374D4000-DEDE-4995-9B63-E3B9FE0C4D29}.Debug|Any CPU.Build.0 = Debug|Any CPU
{374D4000-DEDE-4995-9B63-E3B9FE0C4D29}.Release|Any CPU.ActiveCfg = Release|Any CPU
{374D4000-DEDE-4995-9B63-E3B9FE0C4D29}.Release|Any CPU.Build.0 = Release|Any CPU
- {C60342B1-47D3-4A0E-8081-9B97CE60B7AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C60342B1-47D3-4A0E-8081-9B97CE60B7AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C60342B1-47D3-4A0E-8081-9B97CE60B7AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C60342B1-47D3-4A0E-8081-9B97CE60B7AF}.Release|Any CPU.Build.0 = Release|Any CPU
{84F99CBD-5B86-4428-B263-135B2F67F512}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{84F99CBD-5B86-4428-B263-135B2F67F512}.Debug|Any CPU.Build.0 = Debug|Any CPU
{84F99CBD-5B86-4428-B263-135B2F67F512}.Release|Any CPU.ActiveCfg = Release|Any CPU
{84F99CBD-5B86-4428-B263-135B2F67F512}.Release|Any CPU.Build.0 = Release|Any CPU
- {137D404A-865A-43DB-930C-6DA67DA048DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {137D404A-865A-43DB-930C-6DA67DA048DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {137D404A-865A-43DB-930C-6DA67DA048DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {137D404A-865A-43DB-930C-6DA67DA048DF}.Release|Any CPU.Build.0 = Release|Any CPU
{7E8D2555-2DDD-4757-974F-D5FFD0647671}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7E8D2555-2DDD-4757-974F-D5FFD0647671}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7E8D2555-2DDD-4757-974F-D5FFD0647671}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7E8D2555-2DDD-4757-974F-D5FFD0647671}.Release|Any CPU.Build.0 = Release|Any CPU
+ {47CD7E95-5330-4384-ABCE-2C267C57085C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {47CD7E95-5330-4384-ABCE-2C267C57085C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {47CD7E95-5330-4384-ABCE-2C267C57085C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {47CD7E95-5330-4384-ABCE-2C267C57085C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {127D0D51-FDEA-4E1A-8CD8-34DEB5C2F7F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {127D0D51-FDEA-4E1A-8CD8-34DEB5C2F7F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {127D0D51-FDEA-4E1A-8CD8-34DEB5C2F7F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {127D0D51-FDEA-4E1A-8CD8-34DEB5C2F7F6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {137D404A-865A-43DB-930C-6DA67DA048DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {137D404A-865A-43DB-930C-6DA67DA048DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {137D404A-865A-43DB-930C-6DA67DA048DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {137D404A-865A-43DB-930C-6DA67DA048DF}.Release|Any CPU.Build.0 = Release|Any CPU
{40FEE0BB-FD45-4EFC-85BC-0D602A6892C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{40FEE0BB-FD45-4EFC-85BC-0D602A6892C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40FEE0BB-FD45-4EFC-85BC-0D602A6892C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{40FEE0BB-FD45-4EFC-85BC-0D602A6892C4}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FDB897BD-FCB4-44A1-8D66-AC99F22EC737}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FDB897BD-FCB4-44A1-8D66-AC99F22EC737}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FDB897BD-FCB4-44A1-8D66-AC99F22EC737}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FDB897BD-FCB4-44A1-8D66-AC99F22EC737}.Release|Any CPU.Build.0 = Release|Any CPU
+ {98B10548-DF97-4FB1-8D82-2A12945D4F21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {98B10548-DF97-4FB1-8D82-2A12945D4F21}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {98B10548-DF97-4FB1-8D82-2A12945D4F21}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {98B10548-DF97-4FB1-8D82-2A12945D4F21}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {492D2AF2-950B-4F2E-8079-8794305313FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {492D2AF2-950B-4F2E-8079-8794305313FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {492D2AF2-950B-4F2E-8079-8794305313FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {492D2AF2-950B-4F2E-8079-8794305313FD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CA82D500-1940-4068-A076-D7A8AD459FB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CA82D500-1940-4068-A076-D7A8AD459FB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CA82D500-1940-4068-A076-D7A8AD459FB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CA82D500-1940-4068-A076-D7A8AD459FB0}.Release|Any CPU.Build.0 = Release|Any CPU
+ {11524D98-6C40-4091-A8E1-86463FEE607C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {11524D98-6C40-4091-A8E1-86463FEE607C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {11524D98-6C40-4091-A8E1-86463FEE607C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {11524D98-6C40-4091-A8E1-86463FEE607C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C1BDA476-A5CC-4394-914D-48B0EC31A710}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C1BDA476-A5CC-4394-914D-48B0EC31A710}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C1BDA476-A5CC-4394-914D-48B0EC31A710}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C1BDA476-A5CC-4394-914D-48B0EC31A710}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C60342B1-47D3-4A0E-8081-9B97CE60B7AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C60342B1-47D3-4A0E-8081-9B97CE60B7AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C60342B1-47D3-4A0E-8081-9B97CE60B7AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C60342B1-47D3-4A0E-8081-9B97CE60B7AF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0FA676D5-1349-4086-B33F-65EC2CB7DA41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0FA676D5-1349-4086-B33F-65EC2CB7DA41}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0FA676D5-1349-4086-B33F-65EC2CB7DA41}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0FA676D5-1349-4086-B33F-65EC2CB7DA41}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -233,5 +299,12 @@ Global
{374D4000-DEDE-4995-9B63-E3B9FE0C4D29} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{84F99CBD-5B86-4428-B263-135B2F67F512} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{7E8D2555-2DDD-4757-974F-D5FFD0647671} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
+ {127D0D51-FDEA-4E1A-8CD8-34DEB5C2F7F6} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
+ {FDB897BD-FCB4-44A1-8D66-AC99F22EC737} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
+ {A415F75B-EB6A-49A6-934E-5BA71B83D6EB} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
+ {CA82D500-1940-4068-A076-D7A8AD459FB0} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
+ {C1BDA476-A5CC-4394-914D-48B0EC31A710} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
+ {3819D8A7-C62C-4C47-8DDD-0332D9CE1252} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
+ {0FA676D5-1349-4086-B33F-65EC2CB7DA41} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
EndGlobalSection
EndGlobal
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/Exceptions/GetDscResourceException.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/Exceptions/GetDscResourceException.cs
index 47fdbeee7ef6..8d8880911000 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/Exceptions/GetDscResourceException.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/Exceptions/GetDscResourceException.cs
@@ -22,6 +22,6 @@ namespace Microsoft.WindowsAzure.Commands.Common.Extensions.DSC.Exceptions
public class GetDscResourceException : UnauthorizedAccessException
{
public GetDscResourceException(string resourceName, Exception e) :
- base(String.Format(CultureInfo.CurrentUICulture, Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionGetDscResourceFailed, resourceName), e) { }
+ base(String.Format(CultureInfo.CurrentUICulture, Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionGetDscResourceFailed, resourceName), e) { }
}
}
diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/Publish/DscExtensionPublishCmdletCommonBase.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/Publish/DscExtensionPublishCmdletCommonBase.cs
index cf1e7e644dd3..564492f0ed35 100644
--- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/Publish/DscExtensionPublishCmdletCommonBase.cs
+++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/DSC/Publish/DscExtensionPublishCmdletCommonBase.cs
@@ -15,7 +15,7 @@
namespace Microsoft.WindowsAzure.Commands.Common.Extensions.DSC.Publish
{
- public class DscExtensionPublishCmdletCommonBase : Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet
+ public class DscExtensionPublishCmdletCommonBase : AzureSMCmdlet
{
//Publish
private const string CreateArchiveParameterSetName = "CreateArchive";
@@ -36,7 +36,7 @@ public void ValidatePsVersion()
new InvalidOperationException(
string.Format(
CultureInfo.CurrentUICulture,
- Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionRequiredPsVersion,
+ Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionRequiredPsVersion,
DscExtensionCmdletConstants.MinMajorPowerShellVersion,
major)),
"InvalidPowerShellVersion",
@@ -51,7 +51,7 @@ public void ValidateConfigurationPath(String configurationPath, String paramater
if (!File.Exists(configurationPath))
{
ThrowInvalidArgumentError(
- Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionUploadArchiveConfigFileNotExist,
+ Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionUploadArchiveConfigFileNotExist,
configurationPath);
}
@@ -61,14 +61,14 @@ public void ValidateConfigurationPath(String configurationPath, String paramater
{
if (!DscExtensionCmdletConstants.UploadArchiveAllowedFileExtensions.Contains(Path.GetExtension(configurationFileExtension)))
{
- ThrowInvalidArgumentError(Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension, configurationPath);
+ ThrowInvalidArgumentError(Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension, configurationPath);
}
}
else if (paramaterSetName == CreateArchiveParameterSetName)
{
if (!DscExtensionCmdletConstants.CreateArchiveAllowedFileExtensions.Contains(Path.GetExtension(configurationFileExtension)))
{
- ThrowInvalidArgumentError(Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension, configurationPath);
+ ThrowInvalidArgumentError(Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension, configurationPath);
}
}
}
@@ -78,7 +78,7 @@ public void ValidateConfigurationDataPath(String configurationDataPath)
if (!File.Exists(configurationDataPath))
{
ThrowInvalidArgumentError(
- Microsoft.Azure.Commands.Compute.Properties.Resources.AzureVMDscCannotFindConfigurationDataFile,
+ Microsoft.WindowsAzure.Commands.Common.Properties.Resources.AzureVMDscCannotFindConfigurationDataFile,
configurationDataPath);
}
if (string.Compare(
@@ -86,7 +86,7 @@ public void ValidateConfigurationDataPath(String configurationDataPath)
".psd1",
StringComparison.InvariantCultureIgnoreCase) != 0)
{
- ThrowInvalidArgumentError(Microsoft.Azure.Commands.Compute.Properties.Resources.AzureVMDscInvalidConfigurationDataFile);
+ ThrowInvalidArgumentError(Microsoft.WindowsAzure.Commands.Common.Properties.Resources.AzureVMDscInvalidConfigurationDataFile);
}
}
@@ -104,7 +104,7 @@ public string CreateConfigurationArchive(
var tempZipFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
WriteVerbose(String.Format(
CultureInfo.CurrentUICulture,
- Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionTempFolderVerbose,
+ Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionTempFolderVerbose,
tempZipFolder));
Directory.CreateDirectory(tempZipFolder);
_temporaryDirectoriesToDelete.Add(tempZipFolder);
@@ -163,7 +163,7 @@ public string CreateConfigurationArchive(
{
ThrowTerminatingError(
new ErrorRecord(
- new UnauthorizedAccessException(string.Format(CultureInfo.CurrentUICulture, Microsoft.Azure.Commands.Compute.Properties.Resources.AzureVMDscArchiveAlreadyExists, archive)),
+ new UnauthorizedAccessException(string.Format(CultureInfo.CurrentUICulture, Microsoft.WindowsAzure.Commands.Common.Properties.Resources.AzureVMDscArchiveAlreadyExists, archive)),
"FileAlreadyExists",
ErrorCategory.PermissionDenied,
null));
@@ -172,7 +172,7 @@ public string CreateConfigurationArchive(
else
{
string tempArchiveFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
- WriteVerbose(String.Format(CultureInfo.CurrentUICulture, Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionTempFolderVerbose, tempArchiveFolder));
+ WriteVerbose(String.Format(CultureInfo.CurrentUICulture, Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionTempFolderVerbose, tempArchiveFolder));
Directory.CreateDirectory(tempArchiveFolder);
_temporaryDirectoriesToDelete.Add(tempArchiveFolder);
archive = Path.Combine(tempArchiveFolder, configurationName + DscExtensionCmdletConstants.ZipFileExtension);
@@ -210,7 +210,7 @@ public void PublishConfiguration(
ConfirmAction(
true,
string.Empty,
- Microsoft.Azure.Commands.Compute.Properties.Resources.AzureVMDscCreateArchiveAction,
+ Microsoft.WindowsAzure.Commands.Common.Properties.Resources.AzureVMDscCreateArchiveAction,
outputArchivePath, () => CreateConfigurationArchive(
configurationPath,
configurationDataPath,
@@ -245,7 +245,7 @@ private List CopyRequiredModules(String configurationPath, String tempZi
WriteVerbose(
String.Format(
CultureInfo.CurrentUICulture,
- Microsoft.Azure.Commands.Compute.Properties.Resources.AzureVMDscParsingConfiguration,
+ Microsoft.WindowsAzure.Commands.Common.Properties.Resources.AzureVMDscParsingConfiguration,
configurationPath));
var requiredModules = GetRequiredModules(configurationPath);
@@ -281,7 +281,7 @@ private List CopyRequiredModules(String configurationPath, String tempZi
.AddParameter("tempZipFolder", tempZipFolder);
WriteVerbose(String.Format(
CultureInfo.CurrentUICulture,
- Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionCopyModuleVerbose,
+ Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionCopyModuleVerbose,
module,
tempZipFolder));
powershell.Invoke();
@@ -308,7 +308,7 @@ private void CopyAdditionalContent(String additionalPath, String tempZipFolder,
if (!dir.Exists)
{
ThrowInvalidArgumentError(
- Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionDirectoryNotExist,
+ Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionDirectoryNotExist,
dir);
}
@@ -322,7 +322,7 @@ private void CopyAdditionalContent(String additionalPath, String tempZipFolder,
catch (Exception)
{
ThrowInvalidArgumentError(
- Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionAdditionalContentPathNotExist,
+ Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionAdditionalContentPathNotExist,
additionalPath);
}
}
@@ -372,7 +372,7 @@ private Dictionary GetRequiredModules(String configurationPath)
new ParseException(
String.Format(
CultureInfo.CurrentUICulture,
- Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionStorageParserErrors,
+ Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionStorageParserErrors,
configurationPath,
String.Join("\n", parseResult.Errors.Select(error => error.ToString())))),
"DscConfigurationParseError",
@@ -389,7 +389,7 @@ private Dictionary GetRequiredModules(String configurationPath)
WriteVerbose(String.Format(
CultureInfo.CurrentUICulture,
- Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionRequiredModulesVerbose,
+ Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionRequiredModulesVerbose,
String.Join(", ", requiredModules)));
return requiredModules;
@@ -409,7 +409,7 @@ private void UploadConfigurationArchive(
ConfirmAction(
true,
string.Empty,
- string.Format(CultureInfo.CurrentUICulture, Microsoft.Azure.Commands.Compute.Properties.Resources.AzureVMDscUploadToBlobStorageAction, archivePath),
+ string.Format(CultureInfo.CurrentUICulture, Microsoft.WindowsAzure.Commands.Common.Properties.Resources.AzureVMDscUploadToBlobStorageAction, archivePath),
modulesBlob.Uri.AbsoluteUri, () =>
{
if (!force && modulesBlob.Exists())
@@ -419,7 +419,7 @@ private void UploadConfigurationArchive(
new UnauthorizedAccessException(
string.Format(
CultureInfo.CurrentUICulture,
- Microsoft.Azure.Commands.Compute.Properties.Resources.AzureVMDscStorageBlobAlreadyExists, modulesBlob.Uri.AbsoluteUri)),
+ Microsoft.WindowsAzure.Commands.Common.Properties.Resources.AzureVMDscStorageBlobAlreadyExists, modulesBlob.Uri.AbsoluteUri)),
"StorageBlobAlreadyExists",
ErrorCategory.PermissionDenied,
null));
@@ -429,7 +429,7 @@ private void UploadConfigurationArchive(
WriteVerbose(string.Format(
CultureInfo.CurrentUICulture,
- Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionArchiveUploadedMessage, modulesBlob.Uri.AbsoluteUri));
+ Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionArchiveUploadedMessage, modulesBlob.Uri.AbsoluteUri));
if (passThru)
{
@@ -442,7 +442,7 @@ private void CopyFileToZipFolder(String source, string destination)
{
WriteVerbose(String.Format(
CultureInfo.CurrentUICulture,
- Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionCopyFileVerbose,
+ Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionCopyFileVerbose,
source,
destination));
File.Copy(source, destination);
@@ -461,11 +461,11 @@ public void DeleteTemporaryFiles()
try
{
DeleteFile(file);
- WriteVerbose(string.Format(CultureInfo.CurrentUICulture, Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionDeletedFileMessage, file));
+ WriteVerbose(string.Format(CultureInfo.CurrentUICulture, Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionDeletedFileMessage, file));
}
catch (Exception e)
{
- WriteVerbose(string.Format(CultureInfo.CurrentUICulture, Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionDeleteErrorMessage, file, e.Message));
+ WriteVerbose(string.Format(CultureInfo.CurrentUICulture, Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionDeleteErrorMessage, file, e.Message));
}
}
foreach (var directory in _temporaryDirectoriesToDelete)
@@ -473,11 +473,11 @@ public void DeleteTemporaryFiles()
try
{
DeleteDirectory(directory);
- WriteVerbose(string.Format(CultureInfo.CurrentUICulture, Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionDeletedFileMessage, directory));
+ WriteVerbose(string.Format(CultureInfo.CurrentUICulture, Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionDeletedFileMessage, directory));
}
catch (Exception e)
{
- WriteVerbose(string.Format(CultureInfo.CurrentUICulture, Microsoft.Azure.Commands.Compute.Properties.Resources.PublishVMDscExtensionDeleteErrorMessage, directory, e.Message));
+ WriteVerbose(string.Format(CultureInfo.CurrentUICulture, Microsoft.WindowsAzure.Commands.Common.Properties.Resources.PublishVMDscExtensionDeleteErrorMessage, directory, e.Message));
}
}
}
diff --git a/src/ServiceManagement/Network/Commands.Network.Test/Commands.ServiceManagement.Network.Test.csproj b/src/ServiceManagement/Network/Commands.Network.Test/Commands.ServiceManagement.Network.Test.csproj
index 81ac65db01a5..307875f58b50 100644
--- a/src/ServiceManagement/Network/Commands.Network.Test/Commands.ServiceManagement.Network.Test.csproj
+++ b/src/ServiceManagement/Network/Commands.Network.Test/Commands.ServiceManagement.Network.Test.csproj
@@ -212,12 +212,8 @@
{5ee72c53-1720-4309-b54b-5fb79703195f}
Commands.Common
-
- {c60342b1-47d3-4a0e-8081-9b97ce60b7af}
- Commands.Profile
-
- {C1BDA476-A5CC-4394-914D-48B0EC31A710}
+ {c1bda476-a5cc-4394-914d-48b0ec31a710}
Commands.ScenarioTests.Common
diff --git a/src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj b/src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj
index 11ee008a014b..af13c1f01605 100644
--- a/src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj
+++ b/src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj
@@ -404,6 +404,10 @@
+
+ {c60342b1-47d3-4a0e-8081-9b97ce60b7af}
+ Commands.Profile
+
{c1bda476-a5cc-4394-914d-48b0ec31a710}
Commands.ScenarioTests.Common
@@ -416,10 +420,6 @@
{45c2d687-e0ce-4c97-b731-335834dc2bf2}
Commands.ExpressRoute
-
- {c60342b1-47d3-4a0e-8081-9b97ce60b7af}
- Commands.Profile
-
{bc420543-c04e-4bf3-96e1-cd81b823bdd7}
Commands.Test.Utilities
diff --git a/src/ServiceManagement/Services/Commands.Test/Profile/NewAzureProfileTests.cs b/src/ServiceManagement/Services/Commands.Test/Profile/NewAzureProfileTests.cs
index fa1f31c5cbc4..e4537bddbfa8 100644
--- a/src/ServiceManagement/Services/Commands.Test/Profile/NewAzureProfileTests.cs
+++ b/src/ServiceManagement/Services/Commands.Test/Profile/NewAzureProfileTests.cs
@@ -56,7 +56,7 @@ public void TestMakeRdfeCallWithCreatedProfile()
ProfileTestController.NewRdfeInstance.RunPSTestWithToken((context, token) => string.Format("Test-NewAzureProfileInRDFEMode {0} {1} {2}", token, context.Account.Id, context.Subscription.Id));
}
- [Fact]
+ [Fact(Skip = "Hovsep: Move to ARM")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestMakeArmCallWithCreatedProfile()
{
diff --git a/src/ServiceManagement/Services/Commands.Test/Profile/SelectAzureProfileTests.cs b/src/ServiceManagement/Services/Commands.Test/Profile/SelectAzureProfileTests.cs
index 8d722b68116b..25017a99f9f9 100644
--- a/src/ServiceManagement/Services/Commands.Test/Profile/SelectAzureProfileTests.cs
+++ b/src/ServiceManagement/Services/Commands.Test/Profile/SelectAzureProfileTests.cs
@@ -26,7 +26,7 @@ public void TestSelectDefaultProfile()
ProfileTestController.NewRdfeInstance.RunPSTestWithToken((context, token) => string.Format("Test-SelectDefaultProfile {0} {1} {2}", token, context.Account.Id, context.Subscription.Id));
}
- [Fact]
+ [Fact(Skip="Hovsep: Move to ARM")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestMakeArmCallWithCreatedProfile()
diff --git a/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj b/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj
index 399381b88e6e..0f0b672b75af 100644
--- a/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj
+++ b/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj
@@ -696,10 +696,6 @@
{5ee72c53-1720-4309-b54b-5fb79703195f}
Commands.Common
-
- {c60342b1-47d3-4a0e-8081-9b97ce60b7af}
- Commands.Profile
-
diff --git a/src/ServiceManagement/Services/Commands/Commands.csproj b/src/ServiceManagement/Services/Commands/Commands.csproj
index 916606c06317..74ee5e1f89fc 100644
--- a/src/ServiceManagement/Services/Commands/Commands.csproj
+++ b/src/ServiceManagement/Services/Commands/Commands.csproj
@@ -350,10 +350,6 @@
-
- {c60342b1-47d3-4a0e-8081-9b97ce60b7af}
- Commands.Profile
-
{4900ec4e-8deb-4412-9108-0bc52f81d457}
Commands.Utilities
diff --git a/src/ServiceManagement/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj b/src/ServiceManagement/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj
index 65dc71611ff1..62de3cd7049f 100644
--- a/src/ServiceManagement/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj
+++ b/src/ServiceManagement/Storage/Commands.Storage.Test/Commands.Storage.Test.csproj
@@ -235,6 +235,10 @@
{3b48a77b-5956-4a62-9081-92ba04b02b27}
Commands.Common.Test
+
+ {c1bda476-a5cc-4394-914d-48b0ec31a710}
+ Commands.ScenarioTests.Common
+
{08cf7da7-0392-4a19-b79b-e1ff67cdb81a}
Commands.Storage