Skip to content

Commit 8872dfc

Browse files
matsestmsJinLeimsJinLei
authored
[Az.Tools.Installer]: Updates for a new minor/patch version (#20022)
* fix: set repository to mandatory fix #19839 * chore: formatting * docs: update help * fix: update assembly to 2.21 * chore: add ChangeLog * fix: use shouldsupportprocess as its called by internal command * Update tools/Az.Tools.Installer/ChangeLog.md Co-authored-by: Mats Estensen <[email protected]> * Microsoft.ApplicationInsights to 2.13.1 Revert the change of parameter `Repository` * Remove Az.Tools.Installer-help.xml * Fix typo in Update-AzModule help message Co-authored-by: Jin Lei <[email protected]> Co-authored-by: msJinLei <[email protected]>
1 parent 4fcab27 commit 8872dfc

15 files changed

+36
-25
lines changed

tools/Az.Tools.Installer/Az.Tools.Installer.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
# Assemblies that must be loaded prior to importing this module
5757
RequiredAssemblies = @(
58-
'.\assembly\Microsoft.ApplicationInsights.2.12.0\Microsoft.ApplicationInsights.dll'
58+
'.\assembly\Microsoft.ApplicationInsights.2.13.1\Microsoft.ApplicationInsights.dll'
5959
)
6060

6161
# Script files (.ps1) that are run in the caller's environment prior to importing this module.

tools/Az.Tools.Installer/ChangeLog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Upcoming Release
2+
* Updated telemetry assembly to 2.13.1
3+
* Fixed typo in Az.Tools.Installer
4+
5+
## 0.2.0
6+
* Az.Tools.Installer version 2 (#16321)
7+
8+
## 0.1.0
9+
* Initial release

tools/Az.Tools.Installer/GenerateHelp.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Param(
88
)
99

1010
$ModuleFolder = Join-Path -Path $ArtifactFolder -ChildPath $ModuleName
11-
$TempDocFolder = Join-Path -Path $ArtifactFolder -ChildPath $ModuleName'.Doc'
11+
$TempDocFolder = Join-Path -Path $ModuleFolder -ChildPath 'help'
1212
Import-Module $ModuleFolder
13-
New-MarkdownHelp -Module $ModuleName -OutputFolder $TempDocFolder
14-
New-ExternalHelp –Path $TempDocFolder -OutputPath $ModuleFolder
13+
New-MarkdownHelp -Module $ModuleName -OutputFolder $TempDocFolder -Force
14+
New-ExternalHelp –Path $TempDocFolder -OutputPath $ModuleFolder -Force

tools/Az.Tools.Installer/exports/Install-AzModule.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function Install-AzModule {
4141
[string]
4242
${RequiredAzVersion},
4343

44-
[Parameter(ParameterSetName = 'Default', HelpMessage = 'The Registered Repostory.')]
44+
[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.')]
4545
[ValidateNotNullOrEmpty()]
4646
[string]
4747
${Repository},

tools/Az.Tools.Installer/exports/Uninstall-AzModule.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function Uninstall-AzModule {
3636
[string[]]
3737
${Name},
3838

39-
[Parameter(ParameterSetName = 'Default',HelpMessage = 'Az modules to exclude from uninstallation.', ValueFromPipelineByPropertyName = $true)]
39+
[Parameter(ParameterSetName = 'Default', HelpMessage = 'Az modules to exclude from uninstallation.', ValueFromPipelineByPropertyName = $true)]
4040
[ValidateNotNullOrEmpty()]
4141
[string[]]
4242
${ExcludeModule},

tools/Az.Tools.Installer/exports/Update-AzModule.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function Update-AzModule {
3232
[string[]]
3333
${Name},
3434

35-
[Parameter(HelpMessage = 'The Registered Repostory.')]
35+
[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.')]
3636
[ValidateNotNullOrEmpty()]
3737
[string]
3838
${Repository},

tools/Az.Tools.Installer/help/Install-AzModule.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ Accept wildcard characters: False
8080
```
8181
8282
### -Repository
83-
The Registered Repostory.
83+
The Registered Repository to install module from.
84+
If only one repository is registered in PowerShell, Install-AzModule will use it.
85+
If more than one, please specify the Repository.
8486
8587
```yaml
8688
Type: String

tools/Az.Tools.Installer/help/Update-AzModule.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ Accept wildcard characters: False
5252
```
5353
5454
### -Repository
55-
The Registered Repostory.
55+
The Registered Repository to install module from.
56+
If only one repository is registered in PowerShell, Update-AzModule will use it.
57+
If more than one, please specify the Repository.
5658
5759
```yaml
5860
Type: String

tools/Az.Tools.Installer/internal/Add-RepositoryArgumentCompleter.ps1

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function Add-RepositoryArgumentCompleter()
1717
param(
1818
[Parameter(Mandatory=$true)]
1919
[string[]]$cmdlets,
20-
20+
2121
[Parameter(Mandatory=$true)]
2222
[string]$parameterName
2323
)
@@ -27,17 +27,17 @@ function Add-RepositoryArgumentCompleter()
2727
if(Get-Command -Name Register-ArgumentCompleter -ErrorAction SilentlyContinue)
2828
{
2929
Register-ArgumentCompleter -CommandName $cmdlets -ParameterName $parameterName -ScriptBlock {
30-
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
31-
32-
Get-PSRepository -Name "$wordTocomplete*"-ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Foreach-Object {
33-
[System.Management.Automation.CompletionResult]::new($_.Name, $_.Name, 'ParameterValue', $_.Name)
34-
}
35-
}
30+
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
31+
32+
Get-PSRepository -Name "$wordTocomplete*"-ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Foreach-Object {
33+
[System.Management.Automation.CompletionResult]::new($_.Name, $_.Name, 'ParameterValue', $_.Name)
34+
}
35+
}
3636
}
3737
}
38-
catch
38+
catch
3939
{
40-
# All this functionality is optional, so suppress errors
41-
Write-Debug -Message "Error registering argument completer: $_"
40+
# All this functionality is optional, so suppress errors
41+
Write-Debug -Message "Error registering argument completer: $_"
4242
}
4343
}

tools/Az.Tools.Installer/internal/Install-AzModuleInternal.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ function Install-AzModuleInternal {
207207
$result = Install-SingleModule -ModuleName $tmodule.Name -ModuleVersion $tmodule.Version -InstallModuleParam $tInstallModuleParam -RemovePrevious:($using:confirmUninstallation)
208208
Write-Output $result
209209
} -ThrottleLimit $maxJobCount
210-
#-StreamingHost $Host
211210
}
212211
}
213212
else {

tools/Az.Tools.Installer/internal/Install-AzModule_ByPath.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function Install-AzModule_ByPath {
8181
Scope = if ($Scope) {$Scope} else {'CurrentUser'}
8282
RemovePrevious = $RemovePrevious
8383
Force = $Force
84-
Invoker = $Invoker
84+
Invoker = $Invoker
8585
}
8686
Install-SingleModuleFromPackage @installModuleParams
8787
}

tools/Az.Tools.Installer/internal/Install-AzModule_Default.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ function Install-AzModule_Default {
1717
[CmdletBinding(PositionalBinding = $false, SupportsShouldProcess)]
1818
param(
1919
[Parameter(ValueFromPipelineByPropertyName = $true, Position = 0)]
20-
#[ValidateNotNullOrEmpty()]
2120
[string[]]
2221
${Name},
2322

tools/Az.Tools.Installer/internal/Install-SingleModuleFromPackage.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function Install-SingleModuleFromPackage{
4545

4646
process {
4747
$InstallStarted = Get-Date
48-
$downloader = [ParallelDownloader]::new()
48+
$downloader = [ParallelDownloader]::new()
4949
try {
5050
$filePath = $downloader.Download($Path, $DestinationPath)
5151
$moduleName = $downloader.LastModuleName
@@ -86,14 +86,14 @@ function Install-SingleModuleFromPackage{
8686
}
8787
PowerShellGet\Install-Module @installModuleParams -Name $moduleName -RequiredVersion "$moduleVersion"
8888
}
89-
89+
9090
if (!$WhatIfPreference) {
9191
$moduleInstalled = @()
9292
$moduleInstalled += [PSCustomObject]@{
9393
Name = $moduleName
9494
Version = $moduleVersion
9595
}
96-
Write-Output $moduleInstalled
96+
Write-Output $moduleInstalled
9797
}
9898
}
9999
}

0 commit comments

Comments
 (0)