Skip to content

[Az.Tools.Installer]: Updates for a new minor/patch version #20022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/Az.Tools.Installer/Az.Tools.Installer.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = @(
'.\assembly\Microsoft.ApplicationInsights.2.12.0\Microsoft.ApplicationInsights.dll'
'.\assembly\Microsoft.ApplicationInsights.2.13.1\Microsoft.ApplicationInsights.dll'
)

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
Expand Down
9 changes: 9 additions & 0 deletions tools/Az.Tools.Installer/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Upcoming Release
* Updated telemetry assembly to 2.13.1
* Fixed typo in Az.Tools.Installer

## 0.2.0
* Az.Tools.Installer version 2 (#16321)

## 0.1.0
* Initial release
6 changes: 3 additions & 3 deletions tools/Az.Tools.Installer/GenerateHelp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Param(
)

$ModuleFolder = Join-Path -Path $ArtifactFolder -ChildPath $ModuleName
$TempDocFolder = Join-Path -Path $ArtifactFolder -ChildPath $ModuleName'.Doc'
$TempDocFolder = Join-Path -Path $ModuleFolder -ChildPath 'help'
Import-Module $ModuleFolder
New-MarkdownHelp -Module $ModuleName -OutputFolder $TempDocFolder
New-ExternalHelp –Path $TempDocFolder -OutputPath $ModuleFolder
New-MarkdownHelp -Module $ModuleName -OutputFolder $TempDocFolder -Force
New-ExternalHelp –Path $TempDocFolder -OutputPath $ModuleFolder -Force
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion tools/Az.Tools.Installer/exports/Install-AzModule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function Install-AzModule {
[string]
${RequiredAzVersion},

[Parameter(ParameterSetName = 'Default', HelpMessage = 'The Registered Repostory.')]
[Parameter(ParameterSetName = 'Default', HelpMessage = 'The Registered Repository to install module from. If only one repository is registered in PowerShell, Install-AzModule will use it. If more than one, please specify the Repository.')]
[ValidateNotNullOrEmpty()]
[string]
${Repository},
Expand Down
2 changes: 1 addition & 1 deletion tools/Az.Tools.Installer/exports/Uninstall-AzModule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function Uninstall-AzModule {
[string[]]
${Name},

[Parameter(ParameterSetName = 'Default',HelpMessage = 'Az modules to exclude from uninstallation.', ValueFromPipelineByPropertyName = $true)]
[Parameter(ParameterSetName = 'Default', HelpMessage = 'Az modules to exclude from uninstallation.', ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[string[]]
${ExcludeModule},
Expand Down
2 changes: 1 addition & 1 deletion tools/Az.Tools.Installer/exports/Update-AzModule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function Update-AzModule {
[string[]]
${Name},

[Parameter(HelpMessage = 'The Registered Repostory.')]
[Parameter(HelpMessage = 'The Registered Repository to install module from. If only one repository is registered in PowerShell, Update-AzModule will use it. If more than one, please specify the Repository.')]
[ValidateNotNullOrEmpty()]
[string]
${Repository},
Expand Down
4 changes: 3 additions & 1 deletion tools/Az.Tools.Installer/help/Install-AzModule.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ Accept wildcard characters: False
```

### -Repository
The Registered Repostory.
The Registered Repository to install module from.
If only one repository is registered in PowerShell, Install-AzModule will use it.
If more than one, please specify the Repository.

```yaml
Type: String
Expand Down
4 changes: 3 additions & 1 deletion tools/Az.Tools.Installer/help/Update-AzModule.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ Accept wildcard characters: False
```

### -Repository
The Registered Repostory.
The Registered Repository to install module from.
If only one repository is registered in PowerShell, Update-AzModule will use it.
If more than one, please specify the Repository.

```yaml
Type: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Add-RepositoryArgumentCompleter()
param(
[Parameter(Mandatory=$true)]
[string[]]$cmdlets,

[Parameter(Mandatory=$true)]
[string]$parameterName
)
Expand All @@ -27,17 +27,17 @@ function Add-RepositoryArgumentCompleter()
if(Get-Command -Name Register-ArgumentCompleter -ErrorAction SilentlyContinue)
{
Register-ArgumentCompleter -CommandName $cmdlets -ParameterName $parameterName -ScriptBlock {
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
Get-PSRepository -Name "$wordTocomplete*"-ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Foreach-Object {
[System.Management.Automation.CompletionResult]::new($_.Name, $_.Name, 'ParameterValue', $_.Name)
}
}
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)

Get-PSRepository -Name "$wordTocomplete*"-ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Foreach-Object {
[System.Management.Automation.CompletionResult]::new($_.Name, $_.Name, 'ParameterValue', $_.Name)
}
}
}
}
catch
catch
{
# All this functionality is optional, so suppress errors
Write-Debug -Message "Error registering argument completer: $_"
# All this functionality is optional, so suppress errors
Write-Debug -Message "Error registering argument completer: $_"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ function Install-AzModuleInternal {
$result = Install-SingleModule -ModuleName $tmodule.Name -ModuleVersion $tmodule.Version -InstallModuleParam $tInstallModuleParam -RemovePrevious:($using:confirmUninstallation)
Write-Output $result
} -ThrottleLimit $maxJobCount
#-StreamingHost $Host
}
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function Install-AzModule_ByPath {
Scope = if ($Scope) {$Scope} else {'CurrentUser'}
RemovePrevious = $RemovePrevious
Force = $Force
Invoker = $Invoker
Invoker = $Invoker
}
Install-SingleModuleFromPackage @installModuleParams
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ function Install-AzModule_Default {
[CmdletBinding(PositionalBinding = $false, SupportsShouldProcess)]
param(
[Parameter(ValueFromPipelineByPropertyName = $true, Position = 0)]
#[ValidateNotNullOrEmpty()]
[string[]]
${Name},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function Install-SingleModuleFromPackage{

process {
$InstallStarted = Get-Date
$downloader = [ParallelDownloader]::new()
$downloader = [ParallelDownloader]::new()
try {
$filePath = $downloader.Download($Path, $DestinationPath)
$moduleName = $downloader.LastModuleName
Expand Down Expand Up @@ -86,14 +86,14 @@ function Install-SingleModuleFromPackage{
}
PowerShellGet\Install-Module @installModuleParams -Name $moduleName -RequiredVersion "$moduleVersion"
}

if (!$WhatIfPreference) {
$moduleInstalled = @()
$moduleInstalled += [PSCustomObject]@{
Name = $moduleName
Version = $moduleVersion
}
Write-Output $moduleInstalled
Write-Output $moduleInstalled
}
}
}