上一页 1 ··· 56 57 58 59 60 61 62 63 64 ··· 95 下一页
  2014年8月17日
摘要: 1 $a=get-process2 foreach ($b in $a)3 {4 write-host "hello: $($b.id)"5 }返回结果:hello: 2536hello: 3528hello: 2316hello: 608hello: 732hello: 1392hello: 2... 阅读全文
posted @ 2014-08-17 10:31 momingliu11 阅读(447) 评论(0) 推荐(0)
  2014年8月16日
摘要: 将以下命令保存为 HostsModify.ps1,然后执行即可 1 #该脚本用来添加hosts解析记录。脚本在执行的时候会判断当前用户是否为管理员,如果不是则弹出提示框口,要求输入相应密码 2 If (-NOT ([Security.Principal.WindowsPrincipal][Secur... 阅读全文
posted @ 2014-08-16 22:38 momingliu11 阅读(3069) 评论(0) 推荐(0)
  2014年8月15日
摘要: 方法一:#添加用户变量wmic ENVIRONMENT create name="Testuser",username="%username%",VariableValue="D:\test03"#添加系统变量wmic ENVIRONMENT create name="Testsys",userna... 阅读全文
posted @ 2014-08-15 22:15 momingliu11 阅读(1486) 评论(0) 推荐(0)
摘要: 获取本地管理员组用户方法一:$strComputer = $env:COMPUTERNAME$computer = [ADSI]("WinNT://" + $strComputer + ",computer")$Group = $computer.psbase.children.find("Admi... 阅读全文
posted @ 2014-08-15 20:25 momingliu11 阅读(1791) 评论(0) 推荐(0)
摘要: TableControl跟随Form大小变化:选中TableControl,而不是TablePage,右侧Layout:可以对其设置居上、居下等位置 阅读全文
posted @ 2014-08-15 16:07 momingliu11 阅读(234) 评论(0) 推荐(0)
  2014年8月14日
摘要: 在PS2.0下,button 可以直接调用在 checkbox里面定义的变量,如下:$checkbox1_CheckedChanged={ #TODO: Place custom script here if ($checkbox1.Checked) { $a= 1 } else { $a = 0 ... 阅读全文
posted @ 2014-08-14 23:57 momingliu11 阅读(300) 评论(0) 推荐(0)
摘要: ###################################################################################### THIS IS SAMPLE CODE AND IS ENTIRELY UNSUPPORTED. THIS CODE AND ... 阅读全文
posted @ 2014-08-14 12:01 momingliu11 阅读(676) 评论(0) 推荐(0)
摘要: 新建两个站点,端口分别使用 80 和 81,在DNS中新建A记录,指向该计算机(10.4.34.41)配置过程如下:1.在Windows Server 2012 R2上 安装ARR,URL Rewriter组件。 ARR3.0需要如下组件支持:WebFarmFramework 2.2(该组件又需要W... 阅读全文
posted @ 2014-08-14 10:36 momingliu11 阅读(51298) 评论(7) 推荐(3)
  2014年8月13日
摘要: PS Studio打包好的程序(Win7下),拿到Windows Server 2003(PS2.0),如果提示”.Net framework初始化错误“,则需要安装 .net 3.0如果是PS3.0的话,需要.net 4.0支持。 阅读全文
posted @ 2014-08-13 18:18 momingliu11 阅读(281) 评论(0) 推荐(0)
摘要: 在Button按钮下,将脚本的执行结果返回到richtextbox中:如果返回值包含“failed",则该行标记为红色 1 .\Scripts\升级_ERP.ps1 | % { 2 If ($_.contains("failed")) 3 { 4 $richtextbox1.selectionco... 阅读全文
posted @ 2014-08-13 13:49 momingliu11 阅读(333) 评论(0) 推荐(0)
上一页 1 ··· 56 57 58 59 60 61 62 63 64 ··· 95 下一页