logo
Windows PowerShell basics
On UNIX there is always a man
Search for the available commands
List the attributes and methods of a class

Windows PowerShell basics

The powershell is the scripting language provided by Microsoft on the latest versions of Windows. Microsoft facilitates the administration of a group of machines and avoids, in a lot of cases, going through the clickland.

On UNIX there is always a man

Microsoft is aware of this so (finally) the documentation is 'easy' to access.
get-help command
But Microsoft also knows that real men use unix :) and so it has made an alias ​​between get-help and man. The following code has exactly the same effect.
man command
Now that you know how to retrieve information about the operation of a command, you must know the available commands.

Search for the available commands

Command allows you to obtain a list of the available commands, 'get-command'. It is possible to filter the results by adding as a parameter the name of the command sought. To find commands starting with 'write' type:
get-command write*
Note also that it is possible to use the tab key to auto-complete a command. Now we know that it is good to know that this language is an object language, a class has attributes and methods.

List the attributes and methods of a class

Simply send an object of the relevant class in the command 'get-member' to get the list of attributes / methods. To do this we use a simple '| get-member' after a command returning our object.
get-object | get-member
Note that the command 'get-member has an alias by default, 'gm'.
Be The First To Comment.

Add a comment:





You can use these HTML tags: <br><a><i><b>