Dienstag, 22. September 2015

PowerShell Tip of the Day

Today I wanna talk about a cool cmdlet, that helps you get comfortable with other cmdlets. It is "Show-Command".

Let's assume you want to create a Scheduled Task. One possible step is to create a "ScheduledTaskSetting"-Object - basically a collection of task settings like the restart count and so on.

Useful as PowerShell is, there is a cmdlet "New-ScheduledTaskSettingSet" - with a lot of parameters. You could go this set through one by one... or run the following command:





















Show-Command opens a new window with all parameters or different parameter sets. As you guess you can simply "click" a command together (but don't forget to look at Get-Help! ;) )

But now follows the best: you can copy the generated command to your clipboard (or directly run it; but be careful with that).

So, let's have fun with that. By only running "Show-Command" (without parameters) you see all PowerShell cmdlets and can filter them by Module.

And don't forget "to Update-Help" and especially Get-Help, to learn more about the powerful world of PowerShell.

Keine Kommentare:

Kommentar veröffentlichen