简体   繁体   中英

visual studio code power-shell update-help on mac

I can't update update-help on powershell mac os the error is :

Update-Help : Failed to update Help for the module(s) 'Microsoft.PowerShell.Archive, Microsoft.PowerShell.Core, Microsoft.PowerShell.Host, Microsoft.PowerShell.Management, Microsoft.PowerShell.Security, Microsoft.PowerShell.Utility, PackageManagement, PowerShellGet, PSReadLine' with UI culture(s) {en-US} : Access to the path '/usr/local/microsoft/powershell/6.0.1/en-US/Microsoft.PowerShell.Commands.Management.dll-Help.xml' is denied.At line:1 char:1+ Update-Help + ~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Update-Help], Exception + FullyQualifiedErrorId : UnknownErrorId,Microsoft.PowerShell.Commands.UpdateHelpCommand

Like you I don't spend much time on OSX, but I just did Update-Help on a default OSX install, latest version without use su and it updated just fine.

Try using the -force parameter.

Are you using a different language on your MAC. If you are try setting the culture to US English.

I have seen Update-Help fail even on Windows, if you are not running the VSCode / PowerShell session as admin, or if you are using a non-English OS SKU. So, then you'd do this...

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

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/update-help?view=powershell-5.1

Back in 2016, Update-Help failed for non-Windows clients. See this post.

I'm new to PowerShell and I know on PowerShell on windows you need to run as administrator to update the help files, but how do you update help files on PowerShell on Mac?

Updating help on PowerShell on Mac

But again, I read they got that fixed a while back and as noted, I just did this, and it works fine, even without / with su.

As for some of the errors you are seeing, that is not uncommon to see certain modules not be able to update from time to time. I've seen this more than I care to over the years. I normally just suppress those errors these days.

Update-Help -UICulture en-US -Force -Verbose -ErrorAction SilentlyContinue

This does not mean nothing updated as you'd see form the verbose output.

Powershell command "update-help" fails

When attempting to update the help information on a Windows 10 Pro machine that is joined to a domain, I get this error message:

https://partnersupport.microsoft.com/en-us/par_clientsol/forum/par_win/powershell-command-update-help-fails/d6e5b8b9-75fb-40e5-a90d-90f3dc797b14

Update-Help fails to update 2 modules on Windows 10 Pro x64 #1766 https://github.com/PowerShell/PowerShell/issues/1766

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM