diff --git a/setup/azurecmdfiles.wxi b/setup/azurecmdfiles.wxi index adb9cfdb1ff1..0168d9786271 100644 --- a/setup/azurecmdfiles.wxi +++ b/setup/azurecmdfiles.wxi @@ -2148,6 +2148,9 @@ + + + @@ -2627,8 +2630,8 @@ - - + + @@ -3015,6 +3018,9 @@ + + + @@ -4074,12 +4080,12 @@ - - - + + + @@ -5762,6 +5768,7 @@ + @@ -5919,7 +5926,7 @@ - + @@ -6045,6 +6052,7 @@ + @@ -6382,8 +6390,8 @@ - + diff --git a/src/ResourceManager/Websites/Commands.Websites/Commands.Websites.csproj b/src/ResourceManager/Websites/Commands.Websites/Commands.Websites.csproj index 9b38efaea137..2badbad7973a 100644 --- a/src/ResourceManager/Websites/Commands.Websites/Commands.Websites.csproj +++ b/src/ResourceManager/Websites/Commands.Websites/Commands.Websites.csproj @@ -232,6 +232,10 @@ Commands.Resources - + + + Always + + \ No newline at end of file diff --git a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServicesRdfe.csproj b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServicesRdfe.csproj index 50906470f57b..b3270a09e05e 100644 --- a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServicesRdfe.csproj +++ b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServicesRdfe.csproj @@ -225,7 +225,7 @@ PreserveNewest - + PreserveNewest diff --git a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Microsoft.Azure.Commands.RecoveryServices.dll-help.xml b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Microsoft.Azure.Commands.RecoveryServicesRdfe.dll-help.xml similarity index 100% rename from src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Microsoft.Azure.Commands.RecoveryServices.dll-help.xml rename to src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Microsoft.Azure.Commands.RecoveryServicesRdfe.dll-help.xml diff --git a/tools/Installer/generate.ps1 b/tools/Installer/generate.ps1 index ed2c7dfbe1ee..3f1fcf47e137 100644 --- a/tools/Installer/generate.ps1 +++ b/tools/Installer/generate.ps1 @@ -41,6 +41,7 @@ Remove-Item -Force $resourceManagerPath\AzureRM.DataLakeStore\AzureRM.Tags.psd1 Remove-Item -Force $resourceManagerPath\AzureRM.DataLakeStore\Microsoft.Azure.Commands.Tags.dll-Help.xml -ErrorAction SilentlyContinue Remove-Item -Force $resourceManagerPath\AzureRM.DataLakeStore\Microsoft.Azure.Commands.Tags.format.ps1xml -ErrorAction SilentlyContinue Remove-Item -Force $resourceManagerPath\AzureRM.Intune\AzureRM.Intune.psd1 -ErrorAction SilentlyContinue +Remove-Item -Force $resourceManagerPath\AzureRM.RecoveryServices.Backup\AzureRM.RecoveryServices.psd1 -ErrorAction SilentlyContinue Write-Verbose "Removing duplicated Resources folder" Remove-Item -Recurse -Force $serviceManagementPath\Compute\Resources\ -ErrorAction SilentlyContinue Remove-Item -Recurse -Force $serviceManagementPath\Sql\Resources\ -ErrorAction SilentlyContinue @@ -55,7 +56,7 @@ Write-Verbose "Removing XML help files for helper dlls from $output" $exclude = @("*.dll-Help.xml", "Scaffold.xml", "RoleSettings.xml", "WebRole.xml", "WorkerRole.xml") $include = @("*.xml", "*.lastcodeanalysissucceeded", "*.dll.config", "*.pdb") Get-ChildItem -Include $include -Exclude $exclude -Recurse -Path $output | Remove-Item -Force -Recurse - +Get-ChildItem -Recurse -Path $output -Include *.dll-Help.psd1 | Remove-Item -Force if (Get-Command "heat.exe" -ErrorAction SilentlyContinue) { $azureFiles = Join-Path $env:AzurePSRoot 'setup\azurecmdfiles.wxi' diff --git a/tools/StaticAnalysis/Exceptions/HelpIssues.csv b/tools/StaticAnalysis/Exceptions/HelpIssues.csv index 28c9bc941b80..ad0eee288ce3 100644 --- a/tools/StaticAnalysis/Exceptions/HelpIssues.csv +++ b/tools/StaticAnalysis/Exceptions/HelpIssues.csv @@ -110,3 +110,31 @@ "Microsoft.WindowsAzure.Commands.Profile.dll","Microsoft.WindowsAzure.Commands.Profile.dll-Help.xml","Microsoft.WindowsAzure.Commands.Profile.EnableAzureDataCollectionCommand","1","6050","Help missing for cmdlet Enable-AzureDataCollection implemented by class Microsoft.WindowsAzure.Commands.Profile.EnableAzureDataCollectionCommand","Add Help record for cmdlet Enable-AzureDataCollection to help file." "Microsoft.WindowsAzure.Commands.Profile.dll","Microsoft.WindowsAzure.Commands.Profile.dll-Help.xml","Microsoft.WindowsAzure.Commands.Profile.DisableAzureDataCollectionCommand","1","6050","Help missing for cmdlet Disable-AzureDataCollection implemented by class Microsoft.WindowsAzure.Commands.Profile.DisableAzureDataCollectionCommand","Add Help record for cmdlet Disable-AzureDataCollection to help file." "Microsoft.WindowsAzure.Commands.SqlDatabase.dll","Microsoft.WindowsAzure.Commands.SqlDatabase.dll-Help.xml","Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet.GetAzureSqlDatabaseUsages","1","6050","Help missing for cmdlet Get-AzureSqlDatabaseUsages implemented by class Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet.GetAzureSqlDatabaseUsages","Add Help record for cmdlet Get-AzureSqlDatabaseUsages to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureAppServicePlanMetricsCmdlet","1","6050","Help missing for cmdlet Get-AzureRmAppServicePlanMetrics implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureAppServicePlanMetricsCmdlet","Add Help record for cmdlet Get-AzureRmAppServicePlanMetrics to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.BackupRestore.NewAzureRmWebAppDatabaseBackupSetting","1","6050","Help missing for cmdlet New-AzureRmWebAppDatabaseBackupSetting implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.BackupRestore.NewAzureRmWebAppDatabaseBackupSetting","Add Help record for cmdlet New-AzureRmWebAppDatabaseBackupSetting to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.BackupRestore.RestoreAzureWebAppBackup","1","6050","Help missing for cmdlet Restore-AzureRmWebAppBackup implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.BackupRestore.RestoreAzureWebAppBackup","Add Help record for cmdlet Restore-AzureRmWebAppBackup to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureWebAppCertificate","1","6050","Help missing for cmdlet Get-AzureRmWebAppCertificate implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureWebAppCertificate","Add Help record for cmdlet Get-AzureRmWebAppCertificate to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureWebAppSSLBinding","1","6050","Help missing for cmdlet Get-AzureRmWebAppSSLBinding implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureWebAppSSLBinding","Add Help record for cmdlet Get-AzureRmWebAppSSLBinding to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.NewAzureWebAppSSLBinding","1","6050","Help missing for cmdlet New-AzureRmWebAppSSLBinding implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.NewAzureWebAppSSLBinding","Add Help record for cmdlet New-AzureRmWebAppSSLBinding to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.RemoveAzureWebAppSSLBinding","1","6050","Help missing for cmdlet Remove-AzureRmWebAppSSLBinding implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.RemoveAzureWebAppSSLBinding","Add Help record for cmdlet Remove-AzureRmWebAppSSLBinding to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.GetAzureWebAppSlotCmdlet","1","6050","Help missing for cmdlet Get-AzureRmWebAppSlot implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.GetAzureWebAppSlotCmdlet","Add Help record for cmdlet Get-AzureRmWebAppSlot to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.GetAzureWebAppSlotMetricsCmdlet","1","6050","Help missing for cmdlet Get-AzureRmWebAppSlotMetrics implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.GetAzureWebAppSlotMetricsCmdlet","Add Help record for cmdlet Get-AzureRmWebAppSlotMetrics to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.GetAzureWebAppSlotPublishingProfileCmdlet","1","6050","Help missing for cmdlet Get-AzureRmWebAppSlotPublishingProfile implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.GetAzureWebAppSlotPublishingProfileCmdlet","Add Help record for cmdlet Get-AzureRmWebAppSlotPublishingProfile to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.NewAzureWebAppSlotCmdlet","1","6050","Help missing for cmdlet New-AzureRmWebAppSlot implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.NewAzureWebAppSlotCmdlet","Add Help record for cmdlet New-AzureRmWebAppSlot to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.RemoveAzureWebAppSlotCmdlet","1","6050","Help missing for cmdlet Remove-AzureRmWebAppSlot implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.RemoveAzureWebAppSlotCmdlet","Add Help record for cmdlet Remove-AzureRmWebAppSlot to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.ResetAzureWebAppPSlotublishingProfileCmdlet","1","6050","Help missing for cmdlet Reset-AzureRmWebAppSlotPublishingProfile implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.ResetAzureWebAppPSlotublishingProfileCmdlet","Add Help record for cmdlet Reset-AzureRmWebAppSlotPublishingProfile to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.RestartAzureWebAppSlotCmdlet","1","6050","Help missing for cmdlet Restart-AzureRmWebAppSlot implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.RestartAzureWebAppSlotCmdlet","Add Help record for cmdlet Restart-AzureRmWebAppSlot to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.SetAzureWebAppSlotCmdlet","1","6050","Help missing for cmdlet Set-AzureRmWebAppSlot implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.SetAzureWebAppSlotCmdlet","Add Help record for cmdlet Set-AzureRmWebAppSlot to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.StartAzureWebAppSlotCmdlet","1","6050","Help missing for cmdlet Start-AzureRmWebAppSlot implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.StartAzureWebAppSlotCmdlet","Add Help record for cmdlet Start-AzureRmWebAppSlot to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.StopAzureWebAppSlotCmdlet","1","6050","Help missing for cmdlet Stop-AzureRmWebAppSlot implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.StopAzureWebAppSlotCmdlet","Add Help record for cmdlet Stop-AzureRmWebAppSlot to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.EditAzureWebAppBackupConfiguration","1","6050","Help missing for cmdlet Edit-AzureRmWebAppBackupConfiguration implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.EditAzureWebAppBackupConfiguration","Add Help record for cmdlet Edit-AzureRmWebAppBackupConfiguration to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureWebAppBackupCmdlet","1","6050","Help missing for cmdlet Get-AzureRmWebAppBackup implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureWebAppBackupCmdlet","Add Help record for cmdlet Get-AzureRmWebAppBackup to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureWebAppBackupConfiguration","1","6050","Help missing for cmdlet Get-AzureRmWebAppBackupConfiguration implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureWebAppBackupConfiguration","Add Help record for cmdlet Get-AzureRmWebAppBackupConfiguration to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureWebAppBackupList","1","6050","Help missing for cmdlet Get-AzureRmWebAppBackupList implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureWebAppBackupList","Add Help record for cmdlet Get-AzureRmWebAppBackupList to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureWebAppMetricsCmdlet","1","6050","Help missing for cmdlet Get-AzureRmWebAppMetrics implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureWebAppMetricsCmdlet","Add Help record for cmdlet Get-AzureRmWebAppMetrics to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureWebAppPublishingProfileCmdlet","1","6050","Help missing for cmdlet Get-AzureRmWebAppPublishingProfile implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.GetAzureWebAppPublishingProfileCmdlet","Add Help record for cmdlet Get-AzureRmWebAppPublishingProfile to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.NewAzureWebAppBackup","1","6050","Help missing for cmdlet New-AzureRmWebAppBackup implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.NewAzureWebAppBackup","Add Help record for cmdlet New-AzureRmWebAppBackup to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.RemoveAzureWebAppBackup","1","6050","Help missing for cmdlet Remove-AzureRmWebAppBackup implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.RemoveAzureWebAppBackup","Add Help record for cmdlet Remove-AzureRmWebAppBackup to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.ResetAzureWebAppPublishingProfileCmdlet","1","6050","Help missing for cmdlet Reset-AzureRmWebAppPublishingProfile implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.ResetAzureWebAppPublishingProfileCmdlet","Add Help record for cmdlet Reset-AzureRmWebAppPublishingProfile to help file." +"Microsoft.Azure.Commands.Websites.dll","Microsoft.Azure.Commands.Websites.dll-Help.xml","Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.SetAzureWebAppCmdlet","1","6050","Help missing for cmdlet Set-AzureRmWebApp implemented by class Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps.SetAzureWebAppCmdlet","Add Help record for cmdlet Set-AzureRmWebApp to help file." +"Microsoft.Azure.Commands.RecoveryServicesRdfe.dll","Microsoft.Azure.Commands.RecoveryServicesRdfe.dll-help.xml","Microsoft.Azure.Commands.RecoveryServices.NewAzureSiteRecoverySite","1","6050","Help missing for cmdlet New-AzureSiteRecoverySite implemented by class Microsoft.Azure.Commands.RecoveryServices.NewAzureSiteRecoverySite","Add Help record for cmdlet New-AzureSiteRecoverySite to help file." diff --git a/tools/StaticAnalysis/HelpAnalyzer/HelpAnalyzer.cs b/tools/StaticAnalysis/HelpAnalyzer/HelpAnalyzer.cs index 0faf9eb346c1..b1419ad84192 100644 --- a/tools/StaticAnalysis/HelpAnalyzer/HelpAnalyzer.cs +++ b/tools/StaticAnalysis/HelpAnalyzer/HelpAnalyzer.cs @@ -16,6 +16,8 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Management.Automation; +using System.Text.RegularExpressions; namespace StaticAnalysis.HelpAnalyzer { @@ -25,6 +27,7 @@ namespace StaticAnalysis.HelpAnalyzer public class HelpAnalyzer : IStaticAnalyzer { const int MissingHelp = 6050; + const int MissingHelpFile = 6000; public HelpAnalyzer() { Name = "Help Analyzer"; @@ -34,6 +37,35 @@ public HelpAnalyzer() private AppDomain _appDomain; + private static bool IsAssemblyFile(string path) + { + var assemblyRegexes = new[] + { + new Regex("Microsoft.Azure.Commands.[^.]+.dll$"), + new Regex("Microsoft.WindowsAzure.Commands.[^.]+.dll$"), + new Regex(".Cmdlets.dll$") + }; + + var exceptionRegexes = new[] + { + new Regex("WindowsAzure.Commands.Sync.dll$"), + new Regex("WindowsAzure.Commands.Utilities.dll$"), + new Regex("Commands.Common") + }; + var fileName = Path.GetFileName(path); + var result = false; + foreach (var regex in assemblyRegexes) + { + result = result || regex.IsMatch(fileName); + } + + foreach (var regex in exceptionRegexes) + { + result = result && !regex.IsMatch(fileName); + } + + return result; + } /// /// Given a set of directory paths containing PowerShell module folders, analyze the help /// in the module folders and report any issues @@ -48,6 +80,23 @@ public void Analyze(IEnumerable scopes) { foreach (var directory in Directory.EnumerateDirectories(Path.GetFullPath(baseDirectory))) { + var commandAssemblies = Directory.EnumerateFiles(directory, "*.Commands.*.dll") + .Where (f => IsAssemblyFile(f) && !File.Exists(f + "-Help.xml")); + foreach (var orphanedAssembly in commandAssemblies) + { + helpLogger.LogRecord(new HelpIssue() + { + Assembly = orphanedAssembly, + Description = string.Format("{0} has no matching help file", orphanedAssembly), + Severity = 0, + Remediation = string.Format("Make sure a dll Help file for {0} exists and it is " + + "being copied to the output directory.", orphanedAssembly), + Target = orphanedAssembly, + HelpFile = orphanedAssembly + "-Help.xml", + ProblemId = MissingHelpFile + }); + } + var helpFiles = Directory.EnumerateFiles(directory, "*.dll-Help.xml") .Where(f => !processedHelpFiles.Contains(Path.GetFileName(f), StringComparer.OrdinalIgnoreCase)).ToList();