开发者

Powershell, interactively invoking a static method

I'm sitting at a PowerShell command prompt and following http://technet.microsoft.com/en-us/library/dd347632.aspx

PS C:\> [System.Math]::Sqrt (9)
Unexpected token '(' in expression or statement.
At line:1 char:22
+ [System.Math]::Sqrt ( <<<< 9)
  + CategoryInfo          : PArserError: ((:String) [], ParentContains开发者_运维百科ErrorRecordException
  + FullyQualifiedErrorId : UnexpectedToken

Am I being tricked or did the tutorial give me something that has a syntax error?

How do I do a basic thing like invoke a static method?


Don't have the space after Sqrt:

[System.Math]::Sqrt(9)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜