Skip to content

Conversation

@cormacpayne
Copy link
Member

@cormacpayne cormacpayne commented Oct 7, 2017

Description

Fix for issue #3972


This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.

General Guidelines

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.
  • The pull request does not introduce breaking changes (unless a major version change occurs in the assembly and module).

Testing Guidelines

  • Pull request includes test coverage for the included changes.
  • PowerShell scripts used in tests should do any necessary setup as part of the test or suite setup, and should not use hard-coded values for locations or existing resources.

Cmdlet Signature Guidelines

  • New cmdlets that make changes or have side effects should implement ShouldProcess and have SupportShouldProcess=true specified in the cmdlet attribute. You can find more information on ShouldProcess here.
  • Cmdlet specifies OutputType attribute if any output is produced - if the cmdlet produces no output, it should implement a PassThru parameter.

Cmdlet Parameter Guidelines

  • Parameter types should not expose types from the management library - complex parameter types should be defined in the module.
  • Complex parameter types are discouraged - a parameter type should be simple types as often as possible. If complex types are used, they should be shallow and easily creatable from a constructor or another cmdlet.
  • Cmdlet parameter sets should be mutually exclusive - each parameter set must have at least one mandatory parameter not in other parameter sets.

@cormacpayne
Copy link
Member Author

@cormacpayne
Copy link
Member Author

@azuresdkci test this please

@cormacpayne cormacpayne force-pushed the module-definition-psm1 branch from d1e7dc2 to 639874a Compare October 18, 2017 00:14
<Component Id="cmp18A4F358ED4D601BEBD0BB389140FE09" Guid="*">
<File Id="filDAD2F2CFF2BAC7646E21E7FE8545C982" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.DataFactories\Microsoft.Azure.Management.DataFactories.dll" />
</Component>
<Component Id="cmp43018C27AAE99DE2AACE593F0DA2D07A" Guid="*">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why were these removed? The Microsoft.Data.* dlls are generally a dependencyof the WindowsAzure.Storage library, so references to them shoudl be independent, as it is for WIndosAzure.Storage


# External dependent modules of this module
# ExternalModuleDependencies = ''
# ExternalModuleDependencies = 'AzureRM.Profile'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove these, this should be added and removed by tools

$resourcesFolders = @("de", "es", "fr", "it", "ja", "ko", "ru", "zh-Hans", "zh-Hant")
Get-ChildItem -Include $resourcesFolders -Recurse -Force -Path $output | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue

Write-Verbose "Removing XML help files for helper dlls from $output"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove autogeenrated Xml help files, conde analysis, config files, and symbols

Cleanup-MarkdownHelp -BuildConfig $BuildConfig
$acceptedDlls = $acceptedDlls | where { $_ -ne $null } | % { $_.Substring(2) }

Get-ChildItem -Path $RMFolder.FullName -Filter "*.dll" | where { $acceptedDlls -notcontains $_.Name} | Remove-Item -Force
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worthwhile to ensure we print out these files we are removing so we can debug any issues

}
else
{
$newModules += (@{ModuleName = $module["ModuleName"]; ModuleVersion= $module["ModuleVersion"]})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ensure that we have tested this

$nupkgPath = Join-Path -Path $TempRepoPath -ChildPath ($moduleName + "." + $manifest.Version.ToString() + ".nupkg")
$file = Get-Item $moduleSourcePath
Import-LocalizedData -BindingVariable ModuleMetadata -BaseDirectory $file.DirectoryName -FileName $file.Name
$nupkgPath = Join-Path -Path $TempRepoPath -ChildPath ($moduleName + "." + $ModuleMetadata.ModuleVersion.ToString() + ".nupkg")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before we call PublishModule, we should add in 'ExternalModuleDependencies', and we should remove it before the final nuget package refactoring, liek here: https://github.com/markcowl/azure-powershell/blob/fixazs/tools/PublishModules.ps1#L283

…ne/azure-powershell into module-definition-psm1-spoof

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
…ne/azure-powershell into module-definition-psm1-spoof

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
…ormacpayne/azure-powershell into module-definition-psm1-spoof"

This reverts commit 4e6a420, reversing
changes made to dd8ac94.
…nto module-definition-psm1

# Conflicts:
#	src/ResourceManager/Compute/Commands.Compute/Generated/VirtualMachine/VirtualMachineRunCommandMethod.cs
@cormacpayne
Copy link
Member Author

cormacpayne commented Nov 1, 2017

return "`$module = Get-Module $ModuleName `
if (`$module -ne `$null -and `$module.Version.ToString().CompareTo(`"$MinimumVersion`") -lt 0) `
{ `
Write-Warning `"A later version of $ModuleName was found to be imported already. Please see <link> for more details.`" `
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change these strings:

This module requires $ModuleName version $ModuleVersion. An earlier version of $ModuleName is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information.

…owershell into module-definition-psm1

# Conflicts:
#	src/ResourceManager/ContainerInstance/AzureRM.ContainerInstance.psd1
#	tools/AzureRM.Example.psm1
@markcowl markcowl changed the base branch from preview to release-5.0.0 November 2, 2017 23:23
@cormacpayne
Copy link
Member Author

Closing in favor of #4921

@cormacpayne cormacpayne closed this Nov 3, 2017
@cormacpayne cormacpayne deleted the module-definition-psm1 branch May 2, 2018 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants