MacOS下PowerShell Core无法找到帮助文件问题求助
问题现象
REMARKS
Get-Help cannot find the Help files for this cmdlet on this computer. It
is displaying only partial help.
-- To download and install Help files for the module that includes
this cmdlet, use Update-Help.
-- To view the Help topic for this cmdlet online, type: "Get-Help
Find-Module -Online" or
go to https://go.microsoft.com/fwlink/?LinkID=398574.
解决方案
检查并调整执行策略
执行Get-ExecutionPolicy,若返回Restricted,运行:Set-ExecutionPolicy RemoteSigned -Scope CurrentUser确认时输入
Y即可。强制指定区域更新帮助
直接运行带区域参数的更新命令(优先用英文区域,多数模块帮助更完整):Update-Help -Force -UICulture en-US -Verbose加
-Verbose可查看下载过程日志,排查是否有下载失败的模块。手动安装模块专属帮助包
针对PowerShellGet这类模块,可单独安装其帮助包:Install-Module -Name PowerShellGet-Help -Force修复PowerShell安装路径权限
先查看PowerShell安装目录:$PSHome若该目录下语言文件夹(如
en-US)无写入权限,运行:sudo chmod -R 755 $(echo $PSHome)执行后重新运行
Update-Help。升级PowerShell版本
尝试升级到7.3及以上版本,可能修复旧版本的帮助下载问题:brew upgrade powershell
内容的提问来源于stack exchange,提问作者Yash Shrestha

