Char(DesertFish)

A desert-fish want to go heaven.

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

 

cls


$EventVwr = Get-EventLog -list
foreach ($Log in $EventVwr) {
"{0,-28} {1,-20} {2,8}" -f `
$Log.log, $Log.OverflowAction, $Log.MaximumKilobytes
}


"hex format:        " + "0x{0:x}" -f 500
"Currency Format:   " +"{0,-25:C} {1,25:C}" -f 137.30, 88.90
"Percentage:        " + "{0,-10:p}" -f 0.875, 0.790
"Time and Date      " +"{0:hh}:{0:mm}" -f (Get-date)
"Big number         " +"{0:N5}" -f 10000000000


$DATE = get-date
 foreach ($S in "d","D","f","F","g","G","m","r","s","t","T","u","U",
 "y","dddd, MMMM dd yyyy","M/yy","dd-MM-yy") {
"DATE formatted with $S : {0}" -f $DATE.ToString($S)
 }

 

 

结果:

Application                  OverwriteAsNeeded      102400
Security                                                 
System                       OverwriteAsNeeded      102400
Windows PowerShell           OverwriteAsNeeded       15360
hex format:        0x1f4
Currency Format:   $137.30                                      $88.90
Percentage:        87.50 %  
Time and Date      04:07
Big number         10,000,000,000.00000
DATE formatted with d : 12/16/2010
DATE formatted with D : Thursday, December 16, 2010
DATE formatted with f : Thursday, December 16, 2010 4:07 PM
DATE formatted with F : Thursday, December 16, 2010 4:07:43 PM
DATE formatted with g : 12/16/2010 4:07 PM
DATE formatted with G : 12/16/2010 4:07:43 PM
DATE formatted with m : December 16
DATE formatted with r : Thu, 16 Dec 2010 16:07:43 GMT
DATE formatted with s : 2010-12-16T16:07:43
DATE formatted with t : 4:07 PM
DATE formatted with T : 4:07:43 PM
DATE formatted with u : 2010-12-16 16:07:43Z
DATE formatted with U : Thursday, December 16, 2010 8:07:43 AM
DATE formatted with y : December, 2010
DATE formatted with dddd, MMMM dd yyyy : Thursday, December 16 2010
DATE formatted with M/yy : 12/10
DATE formatted with dd-MM-yy : 16-12-10

posted on 2010-12-16 16:08  沙漠鱼  阅读(590)  评论(0编辑  收藏  举报