Windows Server 1.1 : powershell Partie2

The most useful tool in PowerShell when you do not yet know what to type is Get-Help. It is the built-in discovery system: if you want to manage the event log but cannot remember the cmdlet, you simply search by keyword and let PowerShell guide you. The whole logic is "find the cmdlet, then ask it how to use it".

Finding cmdlets with Get-Help

  • Get-Help *event* — returns every cmdlet whose name contains "event", before or after.
  • Get-Help *eventlog* — narrows down to cmdlets ending with the keyword eventlog.
  • Get-Help Get-EventLog — once you have spotted a candidate, this displays the syntax and a short description.
  • Get-Help Get-EventLog -Detailed — adds detail and parameter descriptions.
  • Get-Help Get-EventLog -Examples — shows ready-to-use examples.
  • Get-Help Get-EventLog -Full — the complete documentation.
  • Get-Help Get-EventLog -Online — opens the Microsoft online page in your browser.

The PowerShell ISE takes discovery even further. As soon as you start typing in the console pane, IntelliSense suggests the cmdlets that match — much like tab-completion but visual — and after a space and a dash it offers the available parameters. The same commands work identically to the console; you can even run ping google.fr and get the same result.

The right-hand pane of ISE lists every module loaded on the system. As an example, if you scroll down to the VpnClient module, you can pick New-VpnConnection and "Show details" to get a form: Name, ServerAddress, AuthenticationMethod, EncryptionLevel. Filling the form and clicking Run executes the equivalent of:

New-VpnConnection -Name "VPN1" -ServerAddress "10.1.1.1" `
                  -AuthenticationMethod EAP -EncryptionLevel Required

You can verify the result in Control Panel → Network and Sharing Center → Change adapter settings: the new VPN connection appears. ISE also lets you save the script with Save As, picking the .ps1 extension, so you can reopen and execute it later from the script pane. That is the whole point of ISE: build a script visually, save it, replay it.

Summary

This lesson teaches learners how to effectively discover and use PowerShell commands through the Get-Help utility and the integrated help system. You'll explore the PowerShell Integrated Scripting Environment (ISE) for writing and executing scripts, discover available modules on your system, and work through a practical example of creating VPN connections using the VPN Client module with proper parameters like server address and authentication methods.

Key points

  • Get-Help is PowerShell's most essential utility for finding commands and understanding their syntax, especially when learning new features
  • Help parameters such as -Examples, -Full, -Detailed, and -Online provide progressively deeper information and access to Microsoft's online documentation
  • PowerShell ISE offers a dual-window interface: a script editor for writing complete scripts alongside an interactive console for testing commands
  • Modules extend PowerShell functionality; you can browse loaded modules, explore their commands, and execute them with graphical wizards or command-line syntax
  • Practical module usage: Add-VpnS2SInterface creates VPN connections by specifying name, server address, authentication method, and encryption protocol

FAQ

What is the most useful PowerShell tool for beginners?

Get-Help is PowerShell's most useful utility. It allows you to search for commands by keyword, view their syntax, and understand how to use them without prior knowledge of the exact command name.

How do you access different levels of help information?

Use parameters with Get-Help: -Examples for usage examples, -Full for comprehensive information, -Detailed for more details, and -Online to access Microsoft's official web documentation.

What is the advantage of using PowerShell ISE over the console?

PowerShell ISE provides a script editor window where you can write and test complete scripts before execution, alongside the interactive console. This makes it easier to work with larger automation tasks and test commands with syntax highlighting and command completion.