ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Learn the power shell

Learn the power shell

原创 Linux操作系统 作者:alexzhou618 时间:2010-01-05 14:30:52 0 删除 编辑
 
set-Alias getlemon Get-Command
 
gps | where {$_.CPU -gt 20}
 
 gps | sort cpu -descending
set-executionPolicy remotesigned
 
 $var = 123
 $var1 ="aaa"
 $var2 ="$var $var1"
 $var2
 
PS C:\Documents and Settings\dmnlemzh> $var3 ='$var $var1';
PS C:\Documents and Settings\dmnlemzh> $var3
$var $var1
 
PS C:\Documents and Settings\dmnlemzh> $var5=get-date;
PS C:\Documents and Settings\dmnlemzh> $var5
2010年1月5日 16:49:15
 
 get-help get-command -full
 
 gps | sort -object ws
 
get-process |
sort ws |
 fl
 
get-process | sort ws | format-table
 
PS C:\Documents and Settings\dmnlemzh> 3+4
7
PS C:\Documents and Settings\dmnlemzh> "kdkdk"+"google.com"
kdkdkgoogle.com
PS C:\Documents and Settings\dmnlemzh> $var=1,2,3,4
PS C:\Documents and Settings\dmnlemzh> $var1=5.7,8,0
PS C:\Documents and Settings\dmnlemzh> $var2=$var+$var1;
PS C:\Documents and Settings\dmnlemzh> #var2
PS C:\Documents and Settings\dmnlemzh> $var2
1
2
3
4
5.7
8
0
PS C:\Documents and Settings\dmnlemzh> $var1="gg"
PS C:\Documents and Settings\dmnlemzh> $var2=$var1*3
PS C:\Documents and Settings\dmnlemzh> $var2
gggggg
 
PS C:\Documents and Settings\dmnlemzh> set-variable var8 1020
PS C:\Documents and Settings\dmnlemzh> $var8
1020
PS C:\Documents and Settings\dmnlemzh> get-variable var*
Name                           Value
----                           -----
var                            {1, 2, 3, 4}
var1                           gg
var2                           gggggg
var3                           $var $var1
var5                           2010-1-5 16:49:15
var8                           1020
PS C:\Documents and Settings\dmnlemzh> get-variable var*
Name                           Value
----                           -----
var                            {1, 2, 3, 4}
var1                           gg
var2                           gggggg
var3                           $var $var1
var5                           2010-1-5 16:49:15
var8                           1020

PS C:\Documents and Settings\dmnlemzh> clear-variable var*
PS C:\Documents and Settings\dmnlemzh> get-variable var*
Name                           Value
----                           -----
var
var1
var2
var3
var5
var8
 
remove-variable
Set-PsDebug -step
 
 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/445851/viewspace-624351/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-04-22

  • 博文量
    52
  • 访问量
    37432