Skip to the main content.

Unlocking the Power of PowerShell: Tips for Success

Empower your scripts – Add help links for effortless user guidance

Tobias & Aleksandar's tip:

Boost your PowerShell functions with easy-to-add help links. Make it simple for users to access tutorials and support directly from your scripts!

 

This is how: 

When creating PowerShell functions, there’s a simple way to add a URL to any website you like. Whether you host your code publicly at GitHub, or whether you run an internal web portal in your company, you can easily have functions point to wikis, example tutorials, or support:


function Invoke-Something
{
   [CmdletBinding(HelpUri='https://support.scriptrunner.com/')]
   param()
   
   'Get-Help Invoke-Something -Online' | Set-ClipBoard
   "In order to see my help, run Get-Help Invoke-Something -Online. I placed the commands into your clipboard."


When you run this function, nothing special happens as it is just illustrating the function wrapper with no special code inside it. However, the function defined a "HelpUri", and users can now easily visit this URL in their browser by using Get‑Help -Online:

  • PS C:\> Get-Help Invoke-Something -OnlinePS C:\> Get-Help Invoke-Something -Online

 

Good2know

Your ultimate PowerShell Cheat Sheet

Unleash the full potential of PowerShell with our handy poster. Whether you're a beginner or a seasoned pro, this cheat sheet is designed to be your go-to resource for the most important and commonly used cmdlets.

The poster is available for download and in paper form.

PowerShell Poster 2023

Get your poster here!

 

 

Related links 

Related posts

6 min read

Using .NET Libraries in PowerShell - GUI dialogs and case-correcting text

In the previous two parts, we looked at a few .NET types and ways to “look inside” and find their hidden methods. This...

8 min read

Using .NET Libraries in PowerShell - Libraries and Types

In part 1, we began exploring how cmdlets internally rely on .NET libraries and how you can access these libraries...

5 min read

Using .NET Libraries in PowerShell - Best Practice and Quick Start

Most PowerShell cmdlets are simply wrappers around underlying .NET libraries. In this series, we’ll take a closer look...

About the author: