开发者

Powershell, interactively invoking a static method

开发者 https://www.devze.com 2023-04-02 02:09 出处:网络
I\'m sitting at a PowerShell command prompt and following http://technet.microsoft.com/en-us/library/dd347632.aspx

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

精彩评论

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