Skip to content

Commit e949c16

Browse files
authored
Merge branch 'master' into SubscriptionFixes
2 parents 27b2e53 + 6332f2d commit e949c16

File tree

2,127 files changed

+977606
-658264
lines changed

Some content is hidden

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

2,127 files changed

+977606
-658264
lines changed

.azure-pipelines/util/analyze-steps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ steps:
1515
inputs:
1616
command: custom
1717
custom: msbuild
18-
arguments: 'build.proj /t:GenerateHelp /p:Configuration=${{ parameters.configuration }}'
18+
arguments: 'build.proj /t:GenerateHelp /p:Configuration=${{ parameters.configuration }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
1919

2020
- task: DotNetCoreCLI@2
2121
displayName: 'Static Analysis'
2222
inputs:
2323
command: custom
2424
custom: msbuild
25-
arguments: 'build.proj /t:StaticAnalysis /p:Configuration=${{ parameters.configuration }}'
25+
arguments: 'build.proj /t:StaticAnalysis /p:Configuration=${{ parameters.configuration }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
2626

2727
- template: publish-artifacts-steps.yml
2828
parameters:

.azure-pipelines/util/build-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ steps:
99
inputs:
1010
command: custom
1111
custom: msbuild
12-
arguments: 'build.proj /t:Build /p:Configuration=${{ parameters.configuration }};TestFramework=${{ parameters.testFramework }}'
12+
arguments: 'build.proj /t:Build /p:Configuration=${{ parameters.configuration }};TestFramework=${{ parameters.testFramework }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
1313

1414
- template: publish-artifacts-steps.yml
1515
parameters:

.azure-pipelines/util/test-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ steps:
1414
inputs:
1515
command: custom
1616
custom: msbuild
17-
arguments: 'build.proj /t:${{ parameters.testTarget }} /p:Configuration=${{ parameters.configuration }};TestFramework=${{ parameters.testFramework }}'
17+
arguments: 'build.proj /t:${{ parameters.testTarget }} /p:Configuration=${{ parameters.configuration }};TestFramework=${{ parameters.testFramework }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
1818

1919
- template: publish-artifacts-steps.yml
2020
parameters:

.azure-pipelines/windows-powershell.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,36 @@ jobs:
1919
testFramework: ${{ variables.TestFramework }}
2020
configuration: ${{ variables.Configuration }}
2121

22+
- job: Analyze
23+
displayName: Analyze
24+
dependsOn: Build
25+
condition: succeeded()
26+
pool:
27+
vmImage: ${{ variables.WindowsImage }}
28+
29+
steps:
30+
- template: util/analyze-steps.yml
31+
parameters:
32+
osName: ${{ variables.WindowsName }}
33+
configuration: ${{ variables.Configuration }}
34+
- task: PowerShell@2
35+
displayName: 'Cleanup Build'
36+
inputs:
37+
targetType: filePath
38+
filePath: tools/CleanupBuild.ps1
39+
pwsh: true
40+
- task: NuGetCommand@2
41+
displayName: 'Download BinSkim'
42+
inputs:
43+
command: custom
44+
arguments: 'install Microsoft.CodeAnalysis.BinSkim -OutputDirectory $(System.DefaultWorkingDirectory)/tools/SecurityTools'
45+
- task: PowerShell@2
46+
displayName: 'Run BinSkim'
47+
inputs:
48+
targetType: filePath
49+
filePath: tools/SecurityTools/RunBinSkim.ps1
50+
pwsh: true
51+
2252
- job: Test
2353
displayName: Test
2454
dependsOn: Build

.github/ISSUE_TEMPLATE/az-module-bug-report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ assignees: ''
3737

3838
## Module versions
3939

40-
<!-- Please run (Get-Module -Name Az.* -ListAvailable) and paste the output in the below code block -->
40+
<!-- Please run (Get-Module -ListAvailable) and paste the output in the below code block -->
4141

4242
```powershell
4343
@@ -53,7 +53,7 @@ assignees: ''
5353

5454
## Error output
5555

56-
<!-- Please run Resolve-AzureRmError and paste the output in the below code block -->
56+
<!-- Please run Resolve-AzError and paste the output in the below code block -->
5757

5858
```
5959

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Feature request
33
about: Suggest a new feature or improvement
44
title: ''
5-
labels: Feature Request
5+
labels: Azure PS Team, Feature Request
66
assignees: ''
77

88
---

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,8 @@ Package
222222
launchSettings.json
223223
/src/StackAdmin/AzureRM/AzureRM.psm1
224224
/src/StackAdmin/AzureStack/AzureStack.psm1
225+
/CsprojMappings.json
225226
/ModuleMappings.json
226-
/SolutionMappings.json
227-
/TestMappings.json
228227
/tools/Modules/tmp
229228
/tools/Az/Az.psm1
230229
/Azure.PowerShell.sln

ChangeLog.md

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

build.proj

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
<UsingTask Condition="$(OnPremiseBuild)" TaskName="CorporateValidation" AssemblyFile="$(CIToolsPath)/Microsoft.WindowsAzure.Tools.Build.Tasks.OnPremise.dll" />
8282
<Import Condition="$(OnPremiseBuild)" Project="$(CIToolsPath)/Microsoft.WindowsAzure.Build.OnPremise.msbuild" />
8383
<UsingTask TaskName="ESRPSignTask" AssemblyFile="$(CISignRepoPath)/tools/sdkbuildtools/tasks/MS.Az.Sdk.OnPremise.Build.Tasks.dll" />
84+
<UsingTask TaskName="FilesChangedTask" AssemblyFile="$(RepoArtifacts)Microsoft.Azure.Build.Tasks/Microsoft.Azure.Build.Tasks.dll" />
85+
<UsingTask TaskName="FilterTask" AssemblyFile="$(RepoArtifacts)Microsoft.Azure.Build.Tasks/Microsoft.Azure.Build.Tasks.dll" />
8486

8587
<Target Name="Clean">
8688
<Message Importance="high" Text="Cleaning Cmdlets..." />
@@ -93,9 +95,13 @@
9395
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(MSBuildThisFileDirectory) -Recurse -Include 'bin','obj','TestResults' | Remove-Item -Recurse -Force -ErrorAction Ignore&quot;" IgnoreExitCode="true" />
9496
</Target>
9597

96-
<Target Name="FilterBuild">
98+
<Target Name="FilterBuild" Condition="$(PullRequestNumber) != ''">
99+
<Message Importance="high" Text="Filtering projects and modules..." />
97100
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)/CreateFilterMappings.ps1&quot;" />
98101

102+
<!-- Build the Microsoft.Azure.Build.Tasks project -->
103+
<Exec Command="dotnet publish $(RepoTools)BuildPackagesTask/Microsoft.Azure.Build.Tasks/Microsoft.Azure.Build.Tasks.csproj -c $(Configuration) -f netstandard2.0" />
104+
99105
<!-- Get all of the files changed in the given pull request -->
100106
<FilesChangedTask RepositoryOwner="Azure" RepositoryName="azure-powershell" PullRequestNumber="$(PullRequestNumber)">
101107
<Output TaskParameter="FilesChanged" ItemName="FilesChanged" />
@@ -105,33 +111,23 @@
105111
<FilterTask FilesChanged="@(FilesChanged)" MapFilePath="./ModuleMappings.json">
106112
<Output TaskParameter="Output" ItemName="ModulesChanged" />
107113
</FilterTask>
108-
<Message Text="Filtering help generation and StaticAnalysis by the following modules:" />
109-
<Message Text="%(ModulesChanged.Identity)" />
110-
<Message Text="Total: @(ModulesChanged->Count())" />
111-
<Message Text="" />
112-
113-
<!-- Get the list of solutions to build -->
114-
<FilterTask FilesChanged="@(FilesChanged)" MapFilePath="./SolutionMappings.json">
115-
<Output TaskParameter="Output" ItemName="CmdletSolutionsToBuild" />
116-
</FilterTask>
117-
<Message Text="Filtering solutions to build by the following:" />
118-
<Message Text="%(CmdletSolutionsToBuild.Identity)" />
119-
<Message Text="Total: @(CmdletSolutionsToBuild->Count())" />
120-
<Message Text="" />
121-
122-
<!--Get the list of tests to be run based on files changed from a specified PullRequestNumber. Mapping between paths and test DLLs is used to produce the list.-->
123-
<FilterTask FilesChanged="@(FilesChanged)" MapFilePath="./TestMappings.json">
124-
<Output TaskParameter="Output" ItemName="XUnitTests" />
114+
<Message Importance="high" Text="Filtering help generation and StaticAnalysis by the following modules:" />
115+
<Message Importance="high" Text="%(ModulesChanged.Identity)" />
116+
<Message Importance="high" Text="Total: @(ModulesChanged->Count())" />
117+
<Message Importance="high" Text="" />
118+
119+
<!-- Get the list of projects to build -->
120+
<FilterTask FilesChanged="@(FilesChanged)" MapFilePath="./CsprojMappings.json">
121+
<Output TaskParameter="Output" ItemName="ProjectsToBuild" />
125122
</FilterTask>
126-
<Message Text="Using these test assemblies:" />
127-
<Message Text="%(XUnitTests.Identity)" />
128-
<Message Text="Total: @(XunitTests->Count())" />
129-
<Message Text="" />
123+
<Message Importance="high" Text="Filtering projects to build by the following:" />
124+
<Message Importance="high" Text="%(ProjectsToBuild.Identity)" />
125+
<Message Importance="high" Text="Total: @(ProjectsToBuild->Count())" />
126+
<Message Importance="high" Text="" />
130127
</Target>
131128

132129
<!-- Build all flavors of the Cmdlets -->
133-
<!-- TODO: Reimplement the FilterBuild and update RepoTasks to NetStandard -->
134-
<Target Name="Build">
130+
<Target Name="Build" DependsOnTargets="FilterBuild">
135131
<Message Importance="high" Text="Building Cmdlets..." />
136132

137133
<MakeDir Directories="$(RepoArtifacts)" />
@@ -142,13 +138,19 @@
142138
<!-- Build and create package content -->
143139
<Exec Command="dotnet --version" />
144140
<Exec Command="dotnet new sln -n Azure.PowerShell -o $(RepoArtifacts) --force" />
145-
<ItemGroup>
141+
<ItemGroup Condition="$(PullRequestNumber) == ''">
146142
<CsprojFiles Include="$(RepoRoot)src/**/*.csproj" Exclude="$(RepoRoot)src/**/*.Test.csproj;$(RepoRoot)src/**/Authenticators.csproj" />
147143
<CsprojFiles Include="$(RepoRoot)src/**/*.Test.csproj" Exclude="$(Net472TestExclude)" Condition="'$(Configuration)' != 'Release' and '$(TestsToRun)' == 'All'" />
148144
<CsprojFiles Include="$(RepoRoot)src/**/*.Test.csproj" Exclude="$(CoreTests)$(Net472TestExclude)" Condition="'$(Configuration)' != 'Release' and '$(TestsToRun)' == 'NonCore'" />
149145
<CsprojFiles Include="$(CoreTests)" Exclude="$(Net472TestExclude)" Condition="'$(Configuration)' != 'Release' and '$(TestsToRun)' == 'Core'" />
150146
<CsprojFiles Include="$(RepoRoot)src/**/Authenticators.csproj" Condition="'$([MSBuild]::IsOsPlatform(&quot;Windows&quot;))' == 'true' and '$(TestFramework)' != 'net472'" />
151147
</ItemGroup>
148+
<ItemGroup Condition="$(PullRequestNumber) != ''">
149+
<!-- Always build and test common code -->
150+
<CsprojFiles Include="$(LibraryRoot)src/Accounts/**/*.csproj;$(LibraryRoot)tools/TestFx/TestFx.csproj" Exclude="$(LibraryRoot)src/**/Authenticators.csproj" />
151+
<CsprojFiles Include="%(ProjectsToBuild.Identity)" />
152+
<CsprojFiles Include="$(LibraryRoot)src/**/Authenticators.csproj" Condition="'$([MSBuild]::IsOsPlatform(&quot;Windows&quot;))' == 'true'" />
153+
</ItemGroup>
152154
<!-- https://github.com/dotnet/cli/issues/6295#issuecomment-346973582 -->
153155
<Exec Command="dotnet sln $(RepoArtifacts)Azure.PowerShell.sln add &quot;%(CsprojFiles.FullPath)&quot;" />
154156
<PropertyGroup>
@@ -168,7 +170,7 @@
168170
<RuntimeDllsIncludeList>Microsoft.Powershell.*.dll,System*.dll,Microsoft.VisualBasic.dll,Microsoft.CSharp.dll,Microsoft.CodeAnalysis.dll,Microsoft.CodeAnalysis.CSharp.dll</RuntimeDllsIncludeList>
169171
<RuntimeDllsExcludeList>System.Security.Cryptography.ProtectedData.dll,System.Configuration.ConfigurationManager.dll,System.Runtime.CompilerServices.Unsafe.dll,System.IO.FileSystem.AccessControl.dll,System.Buffers.dll,System.Text.Encodings.Web.dll,System.CodeDom.dll</RuntimeDllsExcludeList>
170172
</PropertyGroup>
171-
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(RepoArtifacts)/$(Configuration) -Recurse -Include $(RuntimeDllsIncludeList) -Exclude $(RuntimeDllsExcludeList) | Remove-Item -Recurse -Force&quot;" />
173+
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(RepoArtifacts)/$(Configuration) -Recurse -Include $(RuntimeDllsIncludeList) -Exclude $(RuntimeDllsExcludeList) | Where-Object {$_.FullName -notlike '*PreloadAssemblies*' -and $_.FullName -notlike '*NetCoreAssemblies*'} | Remove-Item -Force&quot;" />
172174
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(RepoArtifacts)/$(Configuration) -Recurse -Include 'runtimes' | Remove-Item -Recurse -Force&quot;" Condition="'$(CodeSign)' == 'true'" />
173175

174176
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)/UpdateModules.ps1 -BuildConfig $(Configuration) -Scope $(Scope)&quot;" />
@@ -297,7 +299,7 @@ $(RepoArtifacts)/$(Configuration)/**/Microsoft.Azure.PowerShell.Authenticators.d
297299
<!-- RemoveCodeSignArtifacts.ps1 -->
298300
<Message Text="variables.Remove artifacts section" Importance="high" />
299301
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(RepoArtifacts) -Recurse -Include 'Signed','Unsigned' | Remove-Item -Recurse -Force -Confirm:$false -ErrorAction Ignore&quot;" IgnoreExitCode="true" />
300-
302+
301303
<!-- CheckSignature.ps1 -->
302304
<Message Text="variables.CheckSignature section" Importance="high" />
303305
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)/CheckSignature.ps1 -CustomPath $(RepoArtifacts)/$(Configuration)&quot;" Condition="'$(Scope)' != 'Stack'" />
@@ -326,4 +328,4 @@ $(RepoArtifacts)/$(Configuration)/**/Microsoft.Azure.PowerShell.Authenticators.d
326328
<SetEnvVar EnvName="SignedMsiDir" EnvValue="$(SignedOutputRootDir)" />
327329
</Target>
328330

329-
</Project>
331+
</Project>

documentation/development-docs/azure-powershell-developer-guide.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ The Azure PowerShell Developer Guide was created to help with the development an
3636
- [After Development](#after-development)
3737
- [Misc](#misc)
3838
- [Publish to PowerShell Gallery](#publish-to-powershell-gallery)
39-
- [AsJob Parameter](#asjob-parameter)
40-
- [Argument Completers](#argument-completers)
41-
- [Resource Group Completer](#resource-group-completers)
42-
- [Location Completer](#location-completer)
43-
- [Generic Argument Completer](#generic-argument-completer)
4439

4540
# Prerequisites
4641

@@ -313,4 +308,4 @@ Whenver you make updates to a project, please make sure to update the correspond
313308

314309
## Publish to PowerShell Gallery
315310

316-
To publish your module to the [official PowerShell gallery](http://www.powershellgallery.com/) or the test gallery site, contact the Azure PowerShell team
311+
To publish your module to the [official PowerShell gallery](http://www.powershellgallery.com/) or the test gallery site, contact the Azure PowerShell team

0 commit comments

Comments
 (0)