上一页 1 ··· 54 55 56 57 58 59 60 61 62 ··· 95 下一页
  2014年8月28日
摘要: 安装MSI包使用PowerShell调用WMI对象,你可以执行下面的脚本来安装你的MSI安装包:1 $box="deviis01" #this is the name of your server2 $product= [WMICLASS]"\\$box\ROOT\CIMV2:win32_Produ... 阅读全文
posted @ 2014-08-28 13:59 momingliu11 阅读(2345) 评论(0) 推荐(1)
摘要: powershell.exe -Command "& { ('time={0},user={1}' -f (get-date),(whoami)) | Out-File "d:\user.log" -Append }"给.exe文件添加参数,参数是 array 格式$argus = "$env:wi... 阅读全文
posted @ 2014-08-28 13:57 momingliu11 阅读(7473) 评论(0) 推荐(0)
摘要: WMI服务能够报告详细的硬件信息。通常,每个硬件都来自它们自己的WMI代理类。但是要找出这些硬件类的名字是不容易。所有硬件类都在同一个WMI根下面,你可以在根类查询所有的硬件:Get-WmiObject -Class CIM_LogicalDevice | Out-GridView上面命令能返回基础... 阅读全文
posted @ 2014-08-28 13:37 momingliu11 阅读(626) 评论(0) 推荐(0)
摘要: function Invoke-SQL1:function Invoke-SQL { param( [string] $DBServer, [string] $Database, [string] $SQLCMD ) $connecti... 阅读全文
posted @ 2014-08-28 11:15 momingliu11 阅读(2023) 评论(0) 推荐(0)
  2014年8月26日
摘要: New-Alias -name appcmd -value $env:windir\system32\inetsrv\appcmd.exe这样就可以在当前PS环境下直接使用appcmd了 阅读全文
posted @ 2014-08-26 15:14 momingliu11 阅读(410) 评论(0) 推荐(0)
摘要: PSBASEthe raw view of the objectPSADAPTEDthe fully adapted view of the objectPSEXTENDEDjustthe extended elements of the objectPSOBJECTa view of the ad... 阅读全文
posted @ 2014-08-26 15:00 momingliu11 阅读(562) 评论(0) 推荐(0)
摘要: 示例:空值判断方法:$csv[1].b -eq "" #返回true[string]::isnullorempty($csv[1].b) #返回true$b[1].b -eq [String]::Empty #返回true$csv[1].b.length -eq 0 #返回true$csv[1].b... 阅读全文
posted @ 2014-08-26 11:48 momingliu11 阅读(612) 评论(0) 推荐(0)
  2014年8月25日
摘要: 如果$b="aa,bb"Start-Process PowerShell.exe -Argumentlist "d:\w.ps1 $a $b $c"Start-Process powershell.exe "d:\w.ps1 $a $b $c"则 $b 中的 逗号 会被识别为特殊字符,在此处会自动被... 阅读全文
posted @ 2014-08-25 17:57 momingliu11 阅读(868) 评论(0) 推荐(0)
摘要: $a="asdfghjklqwe"$b=$nullforeach ($_ in ("$a".length-1)..0){$b +=$a[$_]}$b$a="asdfghjklqwe"$b = $a.ToCharArray()[array]::Reverse($b)$b -join ''[array]... 阅读全文
posted @ 2014-08-25 15:20 momingliu11 阅读(199) 评论(0) 推荐(0)
  2014年8月22日
摘要: 1 $testFile="pstips.net"2 dir | Out-File $testFile3 $shell = new-object -comobject "Shell.Application"4 $item = $shell.Namespace(0).ParseName( (Resolv... 阅读全文
posted @ 2014-08-22 09:53 momingliu11 阅读(288) 评论(0) 推荐(0)
上一页 1 ··· 54 55 56 57 58 59 60 61 62 ··· 95 下一页