使用“from”的示例:和“数据”;关键词?
感谢 这篇文章中,我能够想出一个脚本来对 PowerShell 提供的关键字进行排序和显示:
$bindingFlags =
[System.Reflection.BindingFlags]::NonPublic -bor
[System.Reflection.BindingFlags]::Static -bor
[System.Reflection.BindingFlags]::GetField
$keywordTokenReader = [System.Type]::GetType("System.Management.Automation.KeywordTokenReader")
$keywords = $keywordTokenReader.InvokeMember("_keywordTokens", $bindingFlags, $null, $null, $null)
$keywords.GetEnumerator() | Sort-Object -Property Name
我正在查看列表,我了解到 class
、define
、using
和 var
是保留关键字,但出于好奇,是否有人有使用 from
和 的示例>数据
关键字?我似乎找不到任何东西。
谢谢
编辑
使用from
关键字会导致这样的结果:
PS H:\> from
The 'from' keyword is not supported in this version of the language.
At line:1 char:1
帮助主题about_language_keywords
也很有用。
Thanks to this article, I was able to come up with a script which sorts and displays the keywords PowerShell provides:
$bindingFlags =
[System.Reflection.BindingFlags]::NonPublic -bor
[System.Reflection.BindingFlags]::Static -bor
[System.Reflection.BindingFlags]::GetField
$keywordTokenReader = [System.Type]::GetType("System.Management.Automation.KeywordTokenReader")
$keywords = $keywordTokenReader.InvokeMember("_keywordTokens", $bindingFlags, $null, $null, $null)
$keywords.GetEnumerator() | Sort-Object -Property Name
I was looking at the list and I understand that class
, define
, using
and var
are reserved keywords, but just out of curiosity, does anybody have an example using the from
and data
keywords? I can't seem to find anything.
Thanks
EDIT
Use of the from
keyword results in this:
PS H:\> from
The 'from' keyword is not supported in this version of the language.
At line:1 char:1
The help topic about_language_keywords
is also useful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
帮助主题
about_Data_Sections
解释了data
关键字,run:至于
from
关键字,我认为它只是保留的,尚未使用。The help topic
about_Data_Sections
explains thedata
keyword, run:As for the
from
keyword, I think it is just reserved and not yet used.