diff --git a/.azure-pipelines/util/analyze-steps.yml b/.azure-pipelines/util/analyze-steps.yml index 0241121d5af0..0abe54afd0f1 100644 --- a/.azure-pipelines/util/analyze-steps.yml +++ b/.azure-pipelines/util/analyze-steps.yml @@ -31,6 +31,9 @@ steps: - pwsh: 'Install-Module "platyPS", "PSScriptAnalyzer" -Force -Confirm:$false -Scope CurrentUser' displayName: 'Install PowerShell Dependencies' + +- pwsh: 'New-Item -ItemType Directory -Path "Az-Cmdlets-latest"; Invoke-WebRequest -Uri "https://azpspackage.blob.core.windows.net/release/Az-Cmdlets-latest.tar.gz" -OutFile "Az-Cmdlets-latest/Az-Cmdlets-latest.tar.gz"; tar -xvzf "Az-Cmdlets-latest/Az-Cmdlets-latest.tar.gz" -C "Az-Cmdlets-latest"; . Az-Cmdlets-latest/InstallModule.ps1' + displayName: 'Install latest modules' - task: DotNetCoreCLI@2 displayName: 'Generate Help' diff --git a/.ci-config.json b/.ci-config.json index 5ac915199931..c3ea25f1fd8d 100644 --- a/.ci-config.json +++ b/.ci-config.json @@ -87,7 +87,7 @@ "src/{ModuleName}/**/*.md$" ], "phases": [ - "build:related-module", + "build:module", "help:module" ] }, diff --git a/src/Compute/Compute/help/Remove-AzRestorePoint.md b/src/Compute/Compute/help/Remove-AzRestorePoint.md index 5cd53f632005..416c076fdd96 100644 --- a/src/Compute/Compute/help/Remove-AzRestorePoint.md +++ b/src/Compute/Compute/help/Remove-AzRestorePoint.md @@ -3,7 +3,7 @@ external help file: Microsoft.Azure.PowerShell.Cmdlets.Compute.dll-Help.xml Module Name: Az.Compute online version: https://docs.microsoft.com/powershell/module/az.compute/remove-azrestorepoint schema: 2.0.0 ---- +--- # Remove-AzRestorePoint diff --git a/src/Compute/Compute/help/Set-AzVMDiskEncryptionExtension.md b/src/Compute/Compute/help/Set-AzVMDiskEncryptionExtension.md index 62b84e90e882..1106ab2ba77d 100644 --- a/src/Compute/Compute/help/Set-AzVMDiskEncryptionExtension.md +++ b/src/Compute/Compute/help/Set-AzVMDiskEncryptionExtension.md @@ -4,7 +4,7 @@ Module Name: Az.Compute ms.assetid: 6BCB36BC-F5E6-4EDD-983C-8BDE7A9B004D online version: https://docs.microsoft.com/powershell/module/az.compute/set-azvmdiskencryptionextension schema: 2.0.0 ---- +--- # Set-AzVMDiskEncryptionExtension diff --git a/src/Compute/Compute/help/Update-AzRestorePointCollection.md b/src/Compute/Compute/help/Update-AzRestorePointCollection.md index 7be3cdd83272..8df9e9b0ddd0 100644 --- a/src/Compute/Compute/help/Update-AzRestorePointCollection.md +++ b/src/Compute/Compute/help/Update-AzRestorePointCollection.md @@ -3,7 +3,7 @@ external help file: Microsoft.Azure.PowerShell.Cmdlets.Compute.dll-Help.xml Module Name: Az.Compute online version: https://docs.microsoft.com/powershell/module/az.compute/update-azrestorepointcollection schema: 2.0.0 ---- +--- # Update-AzRestorePointCollection @@ -24,7 +24,7 @@ Update Restore Point Collection. Can only Update Tags ### Example 1 ```powershell -Update-AzRestorePointCollection -ResourceGroupName -Name [-Tag] -Confirm +Update-AzRestorePointCollection -ResourceGroupName -Name -Tag -Confirm ``` Add updated tags using -Tag parameter diff --git a/src/Synapse/Synapse/help/New-AzSynapseManagedPrivateEndpoint.md b/src/Synapse/Synapse/help/New-AzSynapseManagedPrivateEndpoint.md index 11189b550c2f..7150d2a868f1 100644 --- a/src/Synapse/Synapse/help/New-AzSynapseManagedPrivateEndpoint.md +++ b/src/Synapse/Synapse/help/New-AzSynapseManagedPrivateEndpoint.md @@ -33,6 +33,16 @@ The **New-AzSynapseManagedPrivateEndpoint** cmdlet creates or updates a managed ### Example 1 ```powershell +<# +endpoint.json +{ + "name": "ContosoManagedPrivateEndpoint", + "properties": { + "privateLinkResourceId": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/contosoResourceGroup/providers/Microsoft.Storage/storageAccounts/contosoStorageAccount", + "groupId": "file" + } +} +#> New-AzSynapseManagedPrivateEndpoint -WorkspaceName ContosoWorkspace -Name ContosoManagedPrivateEndpoint -DefinitionFile "C:\\endpoint.json" ``` diff --git a/tools/StaticAnalysis/ExampleAnalyzer/AnalyzeRules/ParameterNameAndValue.psm1 b/tools/StaticAnalysis/ExampleAnalyzer/AnalyzeRules/ParameterNameAndValue.psm1 index 81e544ae3c41..0343fbf8cf24 100644 --- a/tools/StaticAnalysis/ExampleAnalyzer/AnalyzeRules/ParameterNameAndValue.psm1 +++ b/tools/StaticAnalysis/ExampleAnalyzer/AnalyzeRules/ParameterNameAndValue.psm1 @@ -594,11 +594,17 @@ function Measure-ParameterNameAndValue { if ($null -eq $NextCommandElement -or $NextCommandElement -is [System.Management.Automation.Language.CommandParameterAst]) { # Parameter is not assigned with a value. # Unassigned_Parameter - $global:CommandParameterPair += @{ + # Exclude parameters assigned by , and analyze the next item. + if($CommandElementAst.Parent.Extent.Text -match "-$ParameterName\s*<[!<>]+>"){ + $global:SkipNextCommandElementAst = $true + } + else{ + $global:CommandParameterPair += @{ CommandName = $CommandName ParameterName = $ParameterName ExpressionToParameter = $null ModuleCmdletExNum = $ModuleCmdletExNum + } } return $true } diff --git a/tools/StaticAnalysis/ExampleAnalyzer/Measure-MarkdownOrScript.ps1 b/tools/StaticAnalysis/ExampleAnalyzer/Measure-MarkdownOrScript.ps1 index 35dc9701e866..f179fe4203a2 100644 --- a/tools/StaticAnalysis/ExampleAnalyzer/Measure-MarkdownOrScript.ps1 +++ b/tools/StaticAnalysis/ExampleAnalyzer/Measure-MarkdownOrScript.ps1 @@ -72,7 +72,7 @@ if ($PSCmdlet.ParameterSetName -eq "Markdown") { if ($PSCmdlet.ParameterSetName -eq "Script" -or $AnalyzeScriptsInFile.IsPresent) { # Read and analyze ".ps1" in \ScriptsByExample Write-Output "Analyzing file ..." - $analysisResultsTable += Get-ScriptAnalyzerResult (Get-Item -Path $ScriptPaths) $RulePaths -IncludeDefaultRules:$IncludeDefaultRules.IsPresent -ErrorAction SilentlyContinue + $analysisResultsTable += Get-ScriptAnalyzerResult (Get-Item -Path $ScriptPaths) $RulePaths -IncludeDefaultRules:$IncludeDefaultRules.IsPresent -ErrorAction Continue # Summarize analysis results, output in Result.csv if($analysisResultsTable){ diff --git a/tools/StaticAnalysis/IssueChecker/IssueChecker.cs b/tools/StaticAnalysis/IssueChecker/IssueChecker.cs index ca6bf02b6709..6c25dafd1313 100644 --- a/tools/StaticAnalysis/IssueChecker/IssueChecker.cs +++ b/tools/StaticAnalysis/IssueChecker/IssueChecker.cs @@ -108,6 +108,7 @@ private bool IsSingleExceptionFileHasCriticalIssue(string exceptionFilePath, str } var errorText = new StringBuilder(); errorText.AppendLine(recordList.First().PrintHeaders()); + var warningText = new StringBuilder(); foreach (IReportRecord record in recordList) { if (record.Severity < 2) @@ -117,13 +118,14 @@ private bool IsSingleExceptionFileHasCriticalIssue(string exceptionFilePath, str } else if (record.Severity == 2 && outputWarning) { - errorText.AppendLine(record.FormatRecord()); + warningText.AppendLine(record.FormatRecord()); } } if (hasError) { Console.WriteLine("{0} Errors", exceptionFilePath); Console.WriteLine(errorText.ToString()); + Console.WriteLine(warningText.ToString()); } } return hasError;