
Powershell
文章平均质量分 63
baidu_20993761
这个作者很懒,什么都没留下…
展开
-
Powershell - how to split string by a string
Powershell 4:Works well for Powershell 1 and 4:[Regex]::Split($builder.ToString(), [Environment]::NewLine)原创 2014-09-18 16:11:18 · 1095 阅读 · 0 评论 -
Powershell is learning linux now? - Update-Help update help content to latest.
need administrator privilege to do this.原创 2015-01-05 14:54:00 · 406 阅读 · 0 评论 -
Powershell profile
Powershell profiles help us predefine variables/functions we use routinely and so we have them every time we launch Powershell. Also we can distribute profile to force powershell on all machines have转载 2015-01-02 11:17:17 · 518 阅读 · 0 评论 -
Powershell 32-bit and 64-bit version
Powershell 32-bit and 64-bit version64-bit: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe32-bit: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exealternative way原创 2014-12-29 11:48:36 · 1281 阅读 · 0 评论 -
Powershell: Launch multiple scripts in parallel using Start-Job
Below is the example:$scriptBlock = { param( [string]$name, [string]$gender, [int]$seconds ) Start-Sleep -Seconds $seconds; Echo "$name `t`t $gender" }$jobsList = @()$jobsList += Start-Job原创 2014-12-26 18:28:52 · 606 阅读 · 0 评论 -
Powershell: Launch multiple script in parallel and check exit code for each.
This is the complete code:$p1 = [System.Diagnostics.Process]::Start("Powershell.exe", ".\Desktop\script1.ps1")$p2 = [System.Diagnostics.Process]::Start("Powershell.exe", ".\Desktop\script2.ps1")原创 2014-12-25 19:16:26 · 900 阅读 · 0 评论 -
Powershell: try/catch/finally cannot catch non-terminating error
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") try { $cmd = "Stop-Process -Name abc" Write-Warning "$cmd" In原创 2015-01-15 19:02:16 · 906 阅读 · 0 评论 -
Powershell: Read in file without converting into string array
Get-Content always automatically read in file text as string arrays. if we don't want that, we can use原创 2014-10-16 17:01:28 · 763 阅读 · 0 评论 -
Powershell: Define a Char Array of a specific length
$arr = New-Object int[] 3原创 2014-10-30 12:19:57 · 506 阅读 · 0 评论 -
Powreshell.exe to get full commandline of a specified process
Get-WmiObject Win32_Process -ComputerName localhost -Filter "Name like 'notepad%'" | Format-List -Property ProcessName, Path, CommandLine, WorkingSetSizeProcessName : notepad.exePath原创 2014-11-13 00:35:20 · 540 阅读 · 0 评论 -
Powershell: how to get functions defined in a script?
It is actually part of ScriptCop http://scriptcop.start-automating.com/,转载 2014-10-07 15:11:12 · 649 阅读 · 0 评论 -
Powershell Unit Test Code Coverage Implementation
Unit Test framework:https://github.com/pester/PesterC:\PS>./bin/pester.batjust run pester.bat and all *.tests.ps1 will be原创 2014-09-30 11:00:09 · 717 阅读 · 0 评论 -
In Powershell Cast Unicode character to char - 'WHITE SMILING FACE' (U+263A)
PS D:\> [char]0x00A5¥PS D:\> [char]0x00AE®PS D:\> [char]0x00AC¬PS D:\> [char]0x263a☺PS D:\> [char]0x263b☻PS D:\> [char]0x00E6æ原创 2014-10-07 14:57:27 · 795 阅读 · 0 评论 -
Powershell: schedule job in Powershell
http://blogs.technet.com/b/heyscriptingguy/archive/2012/09/18/create-a-powershell-scheduled-job.aspx$dailyTrigger = New-JobTrigger -Daily -At "2:00 PM"$option = New-ScheduledJobOption -StartIfOnBat原创 2015-01-05 14:57:36 · 1254 阅读 · 0 评论