PowerShell 7.3のUpdate-Helpが失敗する件の備忘録 (追記アリ)

PowerShell(7.3.7)でUpdate-Helpを実行したら失敗した。

Update-Help -Force -ErrorAction SilentlyContinue とすればよいらしい。

PS > Update-Help
Update-Help: Failed to update Help for the module(s) 'ConfigDefenderPerformance, LanguagePackManagement, PSReadline' with UI culture(s) {ja-JP} : One or more errors occurred. (Response status code does not indicate success: 404 (The specified blob does not exist.).).
English-US help content is available and can be installed using: Update-Help -UICulture en-US.
PS > Update-Help -UICulture en-US
Update-Help: Failed to update Help for the module(s) 'ConfigDefenderPerformance, PSReadline' with UI culture(s) {en-US} : One or more errors occurred. (Response status code does not indicate success: 404 (The specified blob does not exist.).).
English-US help content is available and can be installed using: Update-Help -UICulture en-US.
PS > Update-Help -Force -ErrorAction SilentlyContinue
PS >  

github.com

追記

よく見たら、↑これは単にエラーをスキップしているだけで何も解決していないのでは?

PS > Update-Help -Verbose -Force -UICulture en-US

VERBOSE: Resolving URI: "https://aka.ms/powershell73-help"
VERBOSE: Your connection has been redirected to the following URI: "https://pshelpprod.blob.core.windows.net/cabinets/powershell-7.3/"
VERBOSE: Performing the operation "Update-Help" on target "Microsoft.PowerShell.Management, Current Version: 7.2.0.0, Available Version: 7.2.0.0, UICulture: en-US".
VERBOSE: Microsoft.PowerShell.Management: Updated <User>\Documents\PowerShell\Help\en-US\Microsoft.PowerShell.Commands.Management.dll-Help.xml. Culture en-US Version 7.2.0.0
VERBOSE: Resolving URI: "https://aka.ms/powershell72-help"
VERBOSE: Your connection has been redirected to the following URI: "https://pshelpprod.blob.core.windows.net/cabinets/powershell-7.2/"
VERBOSE: Performing the operation "Update-Help" on target "PSReadLine, Current Version: 7.2.0.0, Available Version: 7.2.0.0, UICulture: en-US".
VERBOSE: PSReadLine: Updated <User>\Documents\PowerShell\Help\PSReadLine\en-US\about_PSReadLine.help.txt. Culture en-US Version 7.2.0.0
VERBOSE: PSReadLine: Updated <User>\Documents\PowerShell\Help\PSReadLine\en-US\about_PSReadLine_Functions.help.txt. Culture en-US Version 7.2.0.0
VERBOSE: PSReadLine: Updated <User>\Documents\PowerShell\Help\PSReadLine\en-US\Microsoft.PowerShell.PSReadLine2.dll-Help.xml. Culture en-US Version 7.2.0.0
VERBOSE: Resolving URI: "https://aka.ms/powershell73-help"
VERBOSE: Your connection has been redirected to the following URI: "https://pshelpprod.blob.core.windows.net/cabinets/powershell-7.3/"
VERBOSE: Performing the operation "Update-Help" on target "CimCmdlets, Current Version: 7.2.0.0, Available Version: 7.2.0.0, UICulture: en-US".
VERBOSE: CimCmdlets: Updated <User>\Documents\PowerShell\Help\CimCmdlets\en-US\Microsoft.Management.Infrastructure.CimCmdlets.dll-Help.xml. Culture en-US Version 7.2.0.0
VERBOSE: Resolving URI: "https://aka.ms/powershell70-help"
(略)
VERBOSE: Microsoft.PowerShell.Core: Updated <User>\Documents\PowerShell\Help\en-US\about_While.help.txt. Culture en-US Version 7.2.0.0
VERBOSE: Microsoft.PowerShell.Core: Updated <User>\Documents\PowerShell\Help\en-US\about_Wildcards.help.txt. Culture en-US Version 7.2.0.0
VERBOSE: Microsoft.PowerShell.Core: Updated <User>\Documents\PowerShell\Help\en-US\about_Windows_PowerShell_Compatibility.help.txt. Culture en-US Version 7.2.0.0
VERBOSE: Microsoft.PowerShell.Core: Updated <User>\Documents\PowerShell\Help\en-US\System.Management.Automation.dll-Help.xml. Culture en-US Version 7.2.0.0
Update-Help: Failed to update Help for the module(s) 'ConfigDefenderPerformance, PSReadline' with UI culture(s) {en-US} : One or more errors occurred. (Response status code does not indicate success: 404 (The specified blob does not exist.).).
English-US help content is available and can be installed using: Update-Help -UICulture en-US.
PS >

どうにもPSReadlinePSReadLineが内部的に混在しており、このようになっている様子。v7.3.8 でもまだ解消されていない。

どうやらPowerShell 5.1の時のフォルダが原因のよう。

  • C:\Program Files\WindowsPowerShell\Modules 以下にある PSReadlinePSReadLineに変更する。

  • PowerShell 5.1 (%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe) を管理者権限で起動する。

  • PSReadline(小文字のl) モジュールを一度消してから、PSReadLine(大文字のL) モジュールをインポートする

PS > $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.3570
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.3570
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

PS > Remove-Module PSReadline

PS > Import-Module PSReadLine
  • PowerShell 5.1 を閉じる

  • PowerShell 7.3 で、Update-Help PSReadLine -UICulture en-US とする。エラーが表示されない。

devblogs.microsoft.com