{"id":387,"date":"2014-11-08T00:01:00","date_gmt":"2014-11-08T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2014\/11\/08\/weekend-scripter-use-powershell-to-update-help-on-remote-servers\/"},"modified":"2014-11-08T00:01:00","modified_gmt":"2014-11-08T00:01:00","slug":"weekend-scripter-use-powershell-to-update-help-on-remote-servers","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/weekend-scripter-use-powershell-to-update-help-on-remote-servers\/","title":{"rendered":"Weekend Scripter: Use PowerShell to Update Help on Remote Servers"},"content":{"rendered":"<p><b style=\"font-size:12px\">Summary<\/b><span style=\"font-size:12px\">: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to update Windows PowerShell Help on remote servers.<\/span><\/p>\n<p>Microsoft Scripting Guy, Ed Wilson, is here. One of the great things about any version of Windows PowerShell is the Help that comes with the product. Having access to <b>Get-Help<\/b> is great whether I am working on a server or a workstation. I will admit that even having worked with Windows PowerShell as long as I have, I do not remember every cmdlet, every nuance, every switch and parameter available. I don&rsquo;t think anyone does.<\/p>\n<p>This greatness is actually a double-edged sword. Beginning with Windows PowerShell&nbsp;3.0, the Help is not installed by default; and therefore, it must be updated. This is also a good thing because it helps ensure that the Help is up-to-date, complete, and accurate.<\/p>\n<p>A problem occurs, however, when I have servers that do not have access to the Internet. How do I deal with that situation?<\/p>\n<p>It is tempting to not have any Help on the systems at all. After all, I am pretty good with Windows PowerShell, so I can more than likely do what I need to do. But it is much better if I do have access to Help on the servers. So what do I do? Luckily, Windows PowerShell has an answer. The answer is <b>Save-Help<\/b> and <b>Update-Help<\/b>.<\/p>\n<h2>Download Help<\/h2>\n<p>The first thing I need to do is to download the Help files. This means I need a computer that has access to the Internet. In addition, if I want to get Help for a specific module, it is easiest if I have that module installed because then I will automatically get the Help for that module.<\/p>\n<p>It makes sense for me to download the files directly to a shared location. The first thing I do is delete any files that may be in my shared Help location. I do this to keep from running to issues with trying to overwrite existing files. Here is the command I use to delete the files:<\/p>\n<p style=\"margin-left:30px\">Remove-Item C:\\Shared\\UpdateHelp -Include *.* -Recurse<\/p>\n<p>Now I download the Help files for all of the modules installed on my server. Here is the command I use:<\/p>\n<p style=\"margin-left:30px\">Save-Help -Module * -DestinationPath \\\\dc1\\share\\UpdateHelp<\/p>\n<p>After I download the Help files, I can go to the folder and see what (if anything) happened. Here, I see the Help files:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/hsg-11-8-14-01.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/hsg-11-8-14-01.png\" alt=\"Image of folder\" title=\"Image of folder\" \/><\/a><\/p>\n<h2>Install the Help files on remote servers<\/h2>\n<p>Now I can install the Help files on my remote servers. To do this, I use Windows PowerShell remoting to run the <b>Update-Help<\/b> cmdlet on each of the remote servers. When I call <b>Update-Help<\/b>, I specify the path to my Help shared folder. Here is the command I use from my workstation:<\/p>\n<p style=\"margin-left:30px\">Invoke-Command -ComputerName S1, S2 { Update-help -SourcePath \\\\dc1\\Share\\UpdateHelp -force }<\/p>\n<p>I did not need to specify credentials because I am signed in with an account that has Admin rights on the remote servers. If I was not signed in as an Admin, I would need to specify the <b>&ndash;Credential<\/b> parameter and supply credentials for the command.<\/p>\n<p>I use the <b>Invoke-Command<\/b> cmdlet again to see if I did, in fact, get the Help files updated. Here is the command I use:<\/p>\n<p style=\"margin-left:30px\">Invoke-Command -ComputerName S1, S2 { get-help get-help }<\/p>\n<p>This command is simple, and I simply check to see if I have the Help files for <b>Get-Help<\/b>. Previously, I did not&mdash;now I do. Sweet! It works.<\/p>\n<p>Now I can use the Task Scheduler to run these commands on my various systems, and keep Help automatically updated. Because all of these commands are one-liners, it is really easy to do. Sweet.<\/p>\n<p>I invite you to follow me on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\">Twitter<\/a> and <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\" target=\"_blank\">Facebook<\/a>. If you have any questions, send email to me at <a href=\"mailto:scripter@microsoft.com\" target=\"_blank\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace.<\/p>\n<p><b>Ed Wilson, Microsoft Scripting Guy<\/b><span style=\"font-size:12px\">&nbsp;<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to update Windows PowerShell Help on remote servers. Microsoft Scripting Guy, Ed Wilson, is here. One of the great things about any version of Windows PowerShell is the Help that comes with the product. Having access to Get-Help is great whether I am working [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[463,3,4,61,45],"class_list":["post-387","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-help","tag-scripting-guy","tag-scripting-techniques","tag-weekend-scripter","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to update Windows PowerShell Help on remote servers. Microsoft Scripting Guy, Ed Wilson, is here. One of the great things about any version of Windows PowerShell is the Help that comes with the product. Having access to Get-Help is great whether I am working [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=387"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/387\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}