Hi,
I was studying on how to learn how to find and get powershell cmdlets. However, when following the advice from an article:
http://www.windowsnetworking.com/articles-tutorials/windows-server-2012/powershell-essentials-part3.html
=====================================================
"
I will be the first to admit that the information that is displayed as a result of using the Get-Help cmdlet can be alittle bit overwhelming. However, things really arent as difficult as they might at first appear. The trick is to know
how to read the syntax information. To show you what I mean, lets take a look at the last block of text in the
screen capture above.
The text starts out with Get-PhysicalDisk. Obviously this is the cmdlet that we are using. From there, you will notice
the following text:
[-Usage <usage[]>
Anything that appears in brackets [] references an optional parameter. In this case, we have a bracket [ followed
by Usage. This indicates that Usage is an optional parameter.
The next thing that we see after Usage is <usage[]> this indicates that the Usage parameter requires some
additional information. You cant just use the command Get-PhysicalDisk Usage because even though Usage is
a valid parameter, PowerShell needs more information. It needs to know what kind of usage you are interested in.
Any time you see a word in between the less than < and greater than > signs, it indicates that you are going to
need to provide some additional information to the parameter. So in this case, -Usage is the parameter and
<usage[]> is the additional data.
Of course this raises the question of where we can find this additional data. Well, it is included in the command
syntax. You will notice that the next section of the syntax is:
{Unknown | AutoSelect | ManualSelect | HotSpare | Retired | Journal}
You will notice that the list of words is enclosed in braces {}. These braces indicate that the words within can be
used in conjunction to the optional parameter. To show you what I mean, lets go back to the original example in
which I wanted to find information related to retired physical disks. To get this information, I could use the
following command:
Get-PhysicalDisk Usage Retired
So you can see that I am appending the Usage parameter to the Get-PhysicalDisk cmdlet, and then I am telling
PowerShell what type of Usage I am interested in.
The syntax that is displayed within the above figure continues on, but the basic pattern repeats. The syntax
information lists a number of optional parameters and the data that can be used with those parameters. Some of
the other optional parameters for instance are Description, -Manufacturer, -Model, -CanPool, and HealthStatus,
and the list goes on.
"
=====================================================
I like to follow along so I got it that []= optional , <>=mandatory, {}= list of items
However, I ran the command and got something different:
--------------
PS C:\Users\Administrator.BWCAT> get-help Get-PhysicalDiskNAME
Get-PhysicalDisk
SYNOPSIS
Gets a list of all PhysicalDisk objects visible across any available Storage Management Providers, or optionally a
filtered list.
SYNTAX
Get-PhysicalDisk [-AsJob] [-CanPool <Boolean[]>] [-CimSession <CimSession[]>] [-Description <String[]>]
[-HealthStatus <HealthStatus[]>] [-Manufacturer <String[]>] [-Model <String[]>] [-ThrottleLimit <Int32>]
[-UniqueId <String[]>] [-Usage <Usage[]>] [<CommonParameters>]
Get-PhysicalDisk [-AsJob] [-CanPool <Boolean[]>] [-CimSession <CimSession[]>] [-Description <String[]>]
[-HealthStatus <HealthStatus[]>] [-Manufacturer <String[]>] [-Model <String[]>] [-StoragePool <CimInstance>]
[-ThrottleLimit <Int32>] [-Usage <Usage[]>] [<CommonParameters>]
Get-PhysicalDisk [-AsJob] [-CanPool <Boolean[]>] [-CimSession <CimSession[]>] [-Description <String[]>]
[-HealthStatus <HealthStatus[]>] [-Manufacturer <String[]>] [-Model <String[]>] [-StorageNode <CimInstance>]
[-ThrottleLimit <Int32>] [-Usage <Usage[]>] [<CommonParameters>]
Get-PhysicalDisk [-AsJob] [-CanPool <Boolean[]>] [-CimSession <CimSession[]>] [-Description <String[]>]
[-HasAllocations <Boolean>] [-HealthStatus <HealthStatus[]>] [-Manufacturer <String[]>] [-Model <String[]>]
[-SelectedForUse <Boolean>] [-ThrottleLimit <Int32>] [-Usage <Usage[]>] [-VirtualDisk <CimInstance>]
[-VirtualRangeMax <UInt64>] [-VirtualRangeMin <UInt64>] [<CommonParameters>]
Get-PhysicalDisk [-AsJob] [-CanPool <Boolean[]>] [-CimSession <CimSession[]>] [-Description <String[]>]
[-HealthStatus <HealthStatus[]>] [-Manufacturer <String[]>] [-Model <String[]>] [-StorageEnclosure <CimInstance>]
[-ThrottleLimit <Int32>] [-Usage <Usage[]>] [<CommonParameters>]
Get-PhysicalDisk [-AsJob] [-CanPool <Boolean[]>] [-CimSession <CimSession[]>] [-Description <String[]>]
[-HealthStatus <HealthStatus[]>] [-Manufacturer <String[]>] [-Model <String[]>] [-StorageSubSystem <CimInstance>]
[-ThrottleLimit <Int32>] [-Usage <Usage[]>] [<CommonParameters>]
Get-PhysicalDisk [[-FriendlyName] <String[]>] [-AsJob] [-CanPool <Boolean[]>] [-CimSession <CimSession[]>]
[-Description <String[]>] [-HealthStatus <HealthStatus[]>] [-Manufacturer <String[]>] [-Model <String[]>]
[-ThrottleLimit <Int32>] [-Usage <Usage[]>] [<CommonParameters>]
-------------------------------------
I then tried to do what they said:
Get-PhysicalDisk -Description string ((However you can see that what he says does not seem to apply to the string, and I dont see a list of things to choose from. So I am confused on how to understand the syntax here can someone help me to understand the syntax?
Thanks,
- Edited by wilder7bc 15 hours 20 minutes ago


