码迷,mamicode.com
首页 > 其他好文 > 详细

什么是automatic variable?

时间:2016-08-15 17:10:37      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:

看代码符号$?搞不清楚是什么?

 

看代码.

$share = Get-WmiObject -Class Win32_Share -ComputerName $Server.name -Credential $credentials -Filter "Description=‘Default share‘"

if($?)
{
   "command succeeded"
   $share | Foreach-Object {...}
}
else
{
   "command failed"
}

 

找到定义如下:

Contains the execution status of the last operation. It contains TRUE if the last operation succeeded and FALSE if it failed.

 

Reference

==================

about_Automatic_Variables

https://technet.microsoft.com/en-us/library/hh847768.aspx

什么是automatic variable?

标签:

原文地址:http://www.cnblogs.com/awpatp/p/5773465.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!