PowerShell计算脚本执行时间的实现方法
另一个方法是设置两个时间快照和结束时间,计算它们的时差。这将告诉你Get-Hotfix执行了多久,得到的输出数据里将包含脚本执行的时间:
代码如下:
$start = Get-Date
Get-HotFix
$end = Get-Date
Write-Host -ForegroundColor Red ('Total Runtime: ' + ($end - $start).TotalSeconds)文章出处:http://www.pstips.net/
相关推荐
  清风徐来水波不兴    2020-06-09  
   SirLZF    2020-10-10  
   yishujixiaoxiao    2020-04-08  
   TensorFlowNews    2019-11-28  
   Will0    2010-02-20  
   WinerChopin    2018-03-07  
   DataCastle    2017-06-16  
   Ctommy    2013-11-14  
   yedouble    2013-04-25  
   yanghan    2013-02-20  
   myspace    2019-06-20  
   JackRoser    2017-07-19  
   zupzng    2018-09-12  
   天恒永恒    2018-06-21  
   鲁鲁酱    2017-05-10  
   oraclestudyroad    2011-12-31  
   Pythonandme    2015-03-24  
   网络    2015-03-13  
 