Char(DesertFish)

A desert-fish want to go heaven.

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

2011年4月8日

摘要: Function as below:function Create-ProcessWithWMI ($computer = ".", $commandline = $(throw)){ $ProcessClass = get-wmiobject -query "SELECT * FROM Meta_Class WHERE __Class = 'Win32_Process'"` -namespace "root\cimv2" -computername $computer $results = $ProcessClass 阅读全文
posted @ 2011-04-08 15:00 沙漠鱼 阅读(321) 评论(0) 推荐(0) 编辑

2011年2月28日

摘要: 语言:C# 平台:.NET 3.5 1:如下图,首先创建一个空项目,命名为 HelloWordControlWF。解决方案名称为WFHelloWord 2:重命名WorkFlow1.cs 为HelloWord.cs 3:添加一个codeActivity1 3:双击codeActivity1 添加codeActivity1_ExecuteCode 事件 4:添加依赖属性OutDependency,... 阅读全文
posted @ 2011-02-28 22:08 沙漠鱼 阅读(296) 评论(0) 推荐(0) 编辑

2010年12月16日

摘要: clsfunction HelloWord{ [System.Windows.Forms.MessageBox]::Show("Hello world!")}[Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")$app=[System.Windows.Forms.Application];$myForm=new-object System.Windows.Forms.Form;$myForm.Text="my window";$button1 = new-object System.Windows.Forms.Bu 阅读全文
posted @ 2010-12-16 16:25 沙漠鱼 阅读(346) 评论(0) 推荐(0) 编辑

摘要: filter awk ([scriptblock] $cmd = $args[0], [regex] $delimiter='\s+'){$line = @($delimiter.split($_.Trim()));$countOfBlock = $line.length;$0 = $_;#input from pipelinefor ($i = 1; $i -le $countOfBlock; $i++){Invoke-Expression "`$$i = '$($line[$i - 1])'"}& $cmd} cls$hash = @{}cd "C:\Documents and Setti 阅读全文
posted @ 2010-12-16 16:24 沙漠鱼 阅读(1169) 评论(0) 推荐(0) 编辑

摘要: $ht=@{} $ht.Add("1","55") $ht.Add("11","5555555555555555555555555555") $ht.Add("11111111111111111","5555555555555555555555555555") $ht.Keys | sort |select @{n='ReadCount';e={$_}}, @{n='ElapsedTime';e={$ht[$_].ToString()}} | ft -a $ht.Keys | sort |select @{n='ReadCount';e={$_}}, @{n='ElapsedTime';e={ 阅读全文
posted @ 2010-12-16 16:21 沙漠鱼 阅读(321) 评论(0) 推荐(0) 编辑

摘要: cls$currentDomain = [AppDomain]::CurrentDomain#[AppDomain]::CurrentDomain.GetAssemblies()\#Finding Interesting Classes (Types)$searchtext = "*Environment*"$interstingClass = [AppDomain]::CurrentDomain.GetAssemblies() | ForEach-Object { $_.GetExportedTypes() } | Where-Object { $_ -like $searchtext } 阅读全文
posted @ 2010-12-16 16:20 沙漠鱼 阅读(195) 评论(0) 推荐(0) 编辑

摘要: cd "C:\archived\self\task\powershell\test\Other"clsGet-Date$bcpFileCDSIssuerMirror = "GCDR.all_issuers.data.20100921.bcp"$bcpFileCDSIssuerColumnsRemoved = "bcpFileCDSIssuerColumnsRemoved"if ((Test-Path "$bcpFileCDSIssuerColumnsRemoved" -PathType Leaf) -eq $true){ Remove-Item $bcpFileCDSIssuerColumns 阅读全文
posted @ 2010-12-16 16:19 沙漠鱼 阅读(254) 评论(0) 推荐(0) 编辑

摘要: clsfunction ConverterTZI($arg_tzi,$arg_startIndex,$name="NULL"){ $SYSTEMTIME = 1 |select wYear,wMonth,wDayOfWeek,wDay,wHour,wMinute,wSecond,wMilliseconds,Name Add-Member -InputObject $SYSTEMTIME -MemberType ScriptMethod Ini{ $index = $arg_startIndex $this.wYear = [BitConverter]::ToInt16($arg_tzi, $i 阅读全文
posted @ 2010-12-16 16:18 沙漠鱼 阅读(316) 评论(0) 推荐(0) 编辑

摘要: # http://keithhill.spaces.live.com/blog/cns!5A8D2641E0963A97!756.entryclscd "C:\archived\self\task\powershell\test"$file ="C:\archived\self\task\powershell\test\12.3MB.txt"$filefunction ReadCount{ $ht = @{}; for ($i = 1; $i -le 10MB; $i *= 10) { #write-progress "Measuring gc -readCount $i" "% Comp 阅读全文
posted @ 2010-12-16 16:14 沙漠鱼 阅读(314) 评论(0) 推荐(0) 编辑

摘要: clsfunction aaa{$row3=$table.NewRow();$row3["BugId1"]="23432"$row3["BugId2"]="dfdsfbn"$row3["BugId3"] = 12132$row3["BugId5"] = "gjghjgjgh"$table.Rows.Add($row3);}#创建数据表对象$dataset=New-Object -TypeName System.Data.DataSet;$table = New-Object -TypeName System.Data.DataTable;$column1=$table.Columns.Add( 阅读全文
posted @ 2010-12-16 16:10 沙漠鱼 阅读(745) 评论(0) 推荐(0) 编辑