Skip to content

Commit 0417a1f

Browse files
committed
code comments fixed
2 parents 6c83ae6 + ef88f7b commit 0417a1f

File tree

188 files changed

+11223
-1206
lines changed

Some content is hidden

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

188 files changed

+11223
-1206
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,6 @@ Package
228228
.idea
229229
/src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Logger/bin
230230
/src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Models/bin
231+
/src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Helpers/bin
232+
/src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.Providers/bin
233+
/src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.ServiceClientAdapter/bin

Azure.PowerShell.Netcore.sln

Lines changed: 350 additions & 0 deletions
Large diffs are not rendered by default.

TestMappings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,5 +203,8 @@
203203
],
204204
"tools/BuildPackagesTask/": [
205205
".\\tools\\BuildPackagesTask\\Microsoft.Azure.Build.Tasks.Test\\bin\\Debug\\Microsoft.Azure.Build.Tasks.Test.dll"
206+
],
207+
"tools/RepoTasks/": [
208+
".\\tools\\RepoTasks\\RepoTasks.Cmdlets.Tests\\bin\\Debug\\RepoTasks.Cmdlets.Tests.dll"
206209
]
207210
}

build.proj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171

7272
<StaticAnalysis Include=".\tools\StaticAnalysis\StaticAnalysis.sln" />
7373
<LocalBuildTasks Include="$(LibraryToolsFolder)\BuildPackagesTask\Microsoft.Azure.Build.Tasks.sln" />
74+
<LocalBuildTasks Include="$(LibraryToolsFolder)\RepoTasks\RepoTasks.sln" />
7475
</ItemGroup>
7576

7677
<!-- Tasks -->
@@ -148,6 +149,7 @@
148149
<NuGetRestoreConfigSwitch>-ConfigFile &quot;$(NuGetRestoreConfigFile)&quot;</NuGetRestoreConfigSwitch>
149150
<NuGetRestorePackageSetting>-PackagesDirectory $(LibraryNugetPackageFolder)</NuGetRestorePackageSetting>
150151
<NuGetLocalBuildTaskPackages>-PackagesDirectory $(LibraryToolsFolder)\BuildPackagesTask\packages</NuGetLocalBuildTaskPackages>
152+
<NuGetRepoTasksPackages>-PackagesDirectory $(LibraryToolsFolder)\RepoTasks\packages</NuGetRepoTasksPackages>
151153

152154
<PowerShellCommand Condition=" '$(PowerShellCommand)' == '' ">C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe</PowerShellCommand>
153155
<PowerShellCoreCommand Condition=" '$(PowerShellCoreCommand)' == '' ">pwsh</PowerShellCoreCommand>
@@ -182,6 +184,11 @@
182184
<!-- Restore packages for local build tasks-->
183185
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetLocalBuildTaskPackages)"
184186
ContinueOnError="false" />
187+
<!-- Restore packages for repo tasks tasks-->
188+
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRepoTasksPackages)"
189+
ContinueOnError="false" />
190+
<Exec Command="$(NuGetCommand) restore %(SetupSln.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
191+
ContinueOnError="false" />
185192

186193
<!--Restore the xunit runner needed to run unit tests-->
187194
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\packages.config -PackagesDirectory $(MSBuildProjectDirectory)\packages" />
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright Microsoft Corporation
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software
7+
// distributed under the License is distributed on an "AS IS" BASIS,
8+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
// See the License for the specific language governing permissions and
10+
// limitations under the License.
11+
// ----------------------------------------------------------------------------------
12+
13+
using System;
14+
15+
namespace Microsoft.WindowsAzure.Commands.Common.Attributes
16+
{
17+
[Flags]
18+
public enum ViewControl
19+
{
20+
None = 0,
21+
Table,
22+
List,
23+
All = Table | List,
24+
}
25+
26+
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
27+
public sealed class Ps1XmlAttribute : Attribute
28+
{
29+
public string Label { get; set; }
30+
31+
public ViewControl Target { get; set; } = ViewControl.Table;
32+
}
33+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
<Reference Include="System.Xml" />
112112
</ItemGroup>
113113
<ItemGroup>
114+
<Compile Include="Attributes\Ps1XmlAttribute.cs" />
114115
<Compile Include="LongRunningJobCancelledException.cs" />
115116
<Compile Include="ShouldMethodInvoker.cs" />
116117
<Compile Include="AzureLongRunningJob.cs" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
#
2+
# Module manifest for module 'Azure.AnalysisServices.Netcore'
3+
#
4+
# Generated by: Microsoft Corporation
5+
#
6+
# Generated on: 3/15/2018
7+
#
8+
9+
@{
10+
11+
# Script module or binary module file associated with this manifest.
12+
# RootModule = ''
13+
14+
# Version number of this module.
15+
ModuleVersion = '0.10.0'
16+
17+
# Supported PSEditions
18+
CompatiblePSEditions = 'Core'
19+
20+
# ID used to uniquely identify this module
21+
GUID = 'c717b5a4-1f1b-4a2f-8aa1-bfd09934626e'
22+
23+
# Author of this module
24+
Author = 'Microsoft Corporation'
25+
26+
# Company or vendor of this module
27+
CompanyName = 'Microsoft Corporation'
28+
29+
# Copyright statement for this module
30+
Copyright = 'Microsoft Corporation. All rights reserved.'
31+
32+
# Description of the functionality provided by this module
33+
Description = '[PowerShell .Net Core] Microsoft Azure PowerShell - Analysis Services server management'
34+
35+
# Minimum version of the Windows PowerShell engine required by this module
36+
PowerShellVersion = '5.1'
37+
38+
# Name of the Windows PowerShell host required by this module
39+
# PowerShellHostName = ''
40+
41+
# Minimum version of the Windows PowerShell host required by this module
42+
# PowerShellHostVersion = ''
43+
44+
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45+
# DotNetFrameworkVersion = ''
46+
47+
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48+
# CLRVersion = ''
49+
50+
# Processor architecture (None, X86, Amd64) required by this module
51+
# ProcessorArchitecture = ''
52+
53+
# Modules that must be imported into the global environment prior to importing this module
54+
RequiredModules = @(@{ModuleName = 'AzureRM.Profile.Netcore'; ModuleVersion = '0.10.0'; })
55+
56+
# Assemblies that must be loaded prior to importing this module
57+
RequiredAssemblies = @()
58+
59+
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60+
# ScriptsToProcess = @()
61+
62+
# Type files (.ps1xml) to be loaded when importing this module
63+
# TypesToProcess = @()
64+
65+
# Format files (.ps1xml) to be loaded when importing this module
66+
# FormatsToProcess = @()
67+
68+
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69+
NestedModules = @('.\Microsoft.Azure.Commands.AnalysisServices.Dataplane.dll')
70+
71+
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72+
FunctionsToExport = '*'
73+
74+
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
75+
CmdletsToExport = 'Add-AzureAnalysisServicesAccount',
76+
'Restart-AzureAnalysisServicesInstance',
77+
'Export-AzureAnalysisServicesInstanceLog',
78+
'Sync-AzureAnalysisServicesInstance'
79+
80+
# Variables to export from this module
81+
VariablesToExport = '*'
82+
83+
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
84+
AliasesToExport = '*'
85+
86+
# DSC resources to export from this module
87+
# DscResourcesToExport = @()
88+
89+
# List of all modules packaged with this module
90+
# ModuleList = @()
91+
92+
# List of all files packaged with this module
93+
# FileList = @()
94+
95+
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
96+
PrivateData = @{
97+
98+
PSData = @{
99+
100+
# Tags applied to this module. These help with module discovery in online galleries.
101+
Tags = "Azure", "AzureAS", "AS"
102+
103+
# A URL to the license for this module.
104+
LicenseUri = 'https://aka.ms/azps-license'
105+
106+
# A URL to the main website for this project.
107+
ProjectUri = 'https://github.com/Azure/azure-powershell'
108+
109+
# A URL to an icon representing this module.
110+
# IconUri = ''
111+
112+
# ReleaseNotes of this module
113+
ReleaseNotes = ''
114+
115+
# Prerelease string of this module
116+
# Prerelease = ''
117+
118+
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
119+
# RequireLicenseAcceptance = $false
120+
121+
# External dependent modules of this module
122+
# ExternalModuleDependencies = @()
123+
124+
} # End of PSData hashtable
125+
126+
} # End of PrivateData hashtable
127+
128+
# HelpInfo URI of this module
129+
# HelpInfoURI = ''
130+
131+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
132+
# DefaultCommandPrefix = ''
133+
134+
}
135+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<Import Project="..\..\..\..\tools\Common.Netcore.Dependencies.targets" />
4+
5+
<PropertyGroup>
6+
<TargetFramework>netcoreapp2.0</TargetFramework>
7+
<AssemblyName>Microsoft.Azure.Commands.AnalysisServices.Dataplane</AssemblyName>
8+
<RootNamespace>Microsoft.Azure.Commands.AnalysisServices.Dataplane</RootNamespace>
9+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
10+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
11+
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
12+
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
13+
</PropertyGroup>
14+
15+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
16+
<OutputPath>..\..\..\Package\Debug\ResourceManager\AzureResourceManager\Azure.AnalysisServices.Netcore\</OutputPath>
17+
<DelaySign>false</DelaySign>
18+
<DefineConstants>TRACE;DEBUG;NETSTANDARD</DefineConstants>
19+
</PropertyGroup>
20+
21+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
22+
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\Azure.AnalysisServices.Netcore\</OutputPath>
23+
<DocumentationFile />
24+
<SignAssembly>true</SignAssembly>
25+
<DelaySign>true</DelaySign>
26+
<AssemblyOriginatorKeyFile>MSSharedLibKey.snk</AssemblyOriginatorKeyFile>
27+
<DefineConstants>TRACE;RELEASE;NETSTANDARD;SIGN</DefineConstants>
28+
</PropertyGroup>
29+
30+
<ItemGroup>
31+
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.10" />
32+
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.10" />
33+
<PackageReference Include="Microsoft.WindowsAzure.Management" Version="4.1.1" />
34+
</ItemGroup>
35+
36+
<ItemGroup>
37+
<None Include="Azure.AnalysisServices.Netcore.psd1">
38+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
39+
</None>
40+
</ItemGroup>
41+
42+
<ItemGroup>
43+
<ProjectReference Include="..\..\..\Common\Commands.Common.Authentication.Abstractions\Common.Authentication.Abstractions.Netcore.csproj" />
44+
<ProjectReference Include="..\..\..\Common\Commands.Common\Common.Netcore.csproj" />
45+
</ItemGroup>
46+
47+
<ItemGroup>
48+
<Compile Update="Properties\Resources.Designer.cs">
49+
<DesignTime>true</DesignTime>
50+
<AutoGen>true</AutoGen>
51+
<DependentUpon>Resources.resx</DependentUpon>
52+
</Compile>
53+
</ItemGroup>
54+
55+
<ItemGroup>
56+
<EmbeddedResource Update="Properties\Resources.resx">
57+
<Generator>ResXFileCodeGenerator</Generator>
58+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
59+
</EmbeddedResource>
60+
</ItemGroup>
61+
62+
<ItemGroup>
63+
<Content Include="help\**\*" CopyToOutputDirectory="PreserveNewest" />
64+
</ItemGroup>
65+
66+
</Project>

src/ResourceManager/AnalysisServices/Commands.AnalysisServices.Dataplane/Commands.AnalysisServices.Dataplane.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<DelaySign>true</DelaySign>
3030
<DebugType>pdbonly</DebugType>
3131
<Optimize>true</Optimize>
32-
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\Azure.AnalysisServices</OutputPath>
32+
<OutputPath>..\..\..\Package\Release\ResourceManager\AzureResourceManager\Azure.AnalysisServices\</OutputPath>
3333
<DefineConstants>TRACE</DefineConstants>
3434
<ErrorReport>prompt</ErrorReport>
3535
<WarningLevel>4</WarningLevel>

src/ResourceManager/AnalysisServices/Commands.AnalysisServices.Dataplane/Commands/AddAzureASAccount.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,11 @@ public override void ExecuteCmdlet()
183183
{
184184
AsAzureClientSession.Instance.SetCurrentContext(azureAccount, AsEnvironment);
185185
}
186-
186+
#if NETSTANDARD
187+
var asAzureProfile = AsAzureClientSession.Instance.Login(currentProfile.Context, password, WriteWarning);
188+
#else
187189
var asAzureProfile = AsAzureClientSession.Instance.Login(currentProfile.Context, password);
190+
#endif
188191

189192
WriteObject(asAzureProfile);
190193
}

src/ResourceManager/AnalysisServices/Commands.AnalysisServices.Dataplane/Commands/Export-AzureAsInstanceLog.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,14 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System;
16-
using System.IO;
1716
using System.Globalization;
18-
using System.Linq;
1917
using System.Management.Automation;
20-
using System.Management.Instrumentation;
2118
using System.Net.Http;
2219
using System.Net.Http.Headers;
23-
using System.Threading.Tasks;
2420
using Microsoft.Azure.Commands.Common.Authentication;
2521
using Microsoft.Azure.Commands.AnalysisServices.Dataplane.Models;
2622
using Microsoft.Azure.Commands.AnalysisServices.Dataplane.Properties;
2723
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
28-
using Microsoft.Azure.Commands.Common.Authentication.Models;
29-
using Microsoft.IdentityModel.Clients.ActiveDirectory;
3024
using Microsoft.WindowsAzure.Commands.Utilities.Common;
3125
using Newtonsoft.Json.Linq;
3226

@@ -146,7 +140,11 @@ public override void ExecuteCmdlet()
146140
if (ShouldProcess(Instance, Resources.ExportingLogFromAnalysisServicesServer))
147141
{
148142
var context = AsAzureClientSession.Instance.Profile.Context;
143+
#if NETSTANDARD
144+
AsAzureClientSession.Instance.Login(context, null, null);
145+
#else
149146
AsAzureClientSession.Instance.Login(context, null);
147+
#endif
150148
string accessToken = this.TokenCacheItemProvider.GetTokenFromTokenCache(
151149
AsAzureClientSession.TokenCache, context.Account.UniqueId);
152150

src/ResourceManager/AnalysisServices/Commands.AnalysisServices.Dataplane/Commands/Restart-AzureAsInstance.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,10 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System;
16-
using System.Linq;
1716
using System.Management.Automation;
18-
using System.Management.Instrumentation;
1917
using System.Net.Http;
20-
using System.Net.Http.Headers;
21-
using System.Threading.Tasks;
2218
using Microsoft.Azure.Commands.AnalysisServices.Dataplane.Models;
2319
using Microsoft.Azure.Commands.AnalysisServices.Dataplane.Properties;
24-
using Microsoft.Azure.Commands.Common.Authentication.Models;
25-
using Microsoft.IdentityModel.Clients.ActiveDirectory;
2620
using Microsoft.WindowsAzure.Commands.Utilities.Common;
2721
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
2822

@@ -137,7 +131,11 @@ public override void ExecuteCmdlet()
137131
if (ShouldProcess(Instance, Resources.RestartingAnalysisServicesServer))
138132
{
139133
var context = AsAzureClientSession.Instance.Profile.Context;
134+
#if NETSTANDARD
135+
AsAzureClientSession.Instance.Login(context, null, null);
136+
#else
140137
AsAzureClientSession.Instance.Login(context, null);
138+
#endif
141139
string accessToken = this.TokenCacheItemProvider.GetTokenFromTokenCache(AsAzureClientSession.TokenCache, context.Account.UniqueId);
142140

143141
Uri restartBaseUri = new Uri(string.Format("{0}{1}{2}", Uri.UriSchemeHttps, Uri.SchemeDelimiter, context.Environment.Name));

0 commit comments

Comments
 (0)