get-help exit
pulls up help on the Exit-PSSession cmdlet
get-help Exit-PSSession -full
gets me this hint
"The Exit keyword has the same effect as using Exit-PSSession."
(Which by the way I don't find to be true in general.)
Now that I know exit is a keyword I can use
get-help keywords -full
to get better documentation on exit as a keyword, and find all the other
PowerShell keywords.
I'm still hoping someday to find a formal definitive PowerShell language
reference published by Microsoft.
- Larry
Martin
"Larry__Weiss" <l...@airmail.net> wrote in message
news:uYzqyZCq...@TK2MSFTNGP06.phx.gbl...
"Larry__Weiss" wrote:
> .
>
Here are the lists I get from
get-help about_reserved_words -full
TOPIC
about_Reserved_Words
SHORT DESCRIPTION
Lists the reserved words that cannot be used as identifiers because they
have a special meaning in Windows PowerShell.
Reserved words (both a reserved word and a keyword unless indicated otherwise)
Break
Continue
Do
Else
Elseif
Filter
For
Foreach
Function
If
In
Local <-- not a keyword
Private <-- not a keyword
Return
Switch
Until
Where <-- not a keyword
While
==============================================
get-help about_language_keywords -full
TOPIC
about_Language_Keywords
SHORT DESCRIPTION
Describes the keywords in the Windows PowerShell scripting language.
Keywords (both a reserved word and a keyword unless indicated otherwise)
Begin <-- not a reserved word
Break
Catch <-- not a reserved word
Continue
Data <-- not a reserved word
Do
Dynamicparam <-- not a reserved word
Else
Elseif
End <-- not a reserved word
Exit <-- not a reserved word
Filter <-- not a reserved word
Finally <-- not a reserved word
For
Foreach
From <-- not a reserved word
Function
If
In
Param <-- not a reserved word
Process <-- not a reserved word
Return
Switch
Throw <-- not a reserved word
Trap <-- not a reserved word
Try <-- not a reserved word
Until
While
I'm starting to get confused by the three categories so far
Reserved word only
Keyword only
Both a reserved word and also a keyword
And what is the meaning of "identifier" in the short description returned by
get-help about_reserved_words -full
?
Bruce Payette's book "PowerShell in Action" does not use "identifier" in a way
that I can match up with
"...the reserved words that cannot be used as identifiers..."
- Larry
An identifer is taken to be the name of something - often a variable name.
It means that the reserved words can't be used as the names for variables or
functions etc
--
Richard Siddaway
All scripts are supplied "as is" and with no warranty
PowerShell MVP
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk
"Larry__Weiss" wrote:
> .
>
For example I can code
PS C:> $if = 1
PS C:> if ($if -eq 1) {$if}
1
PS C:> dir variable:if
Name Value
---- -----
if 1
PS C:>