2010/07/23

BB 常用軟體。

發送自我的BlackBerry®智慧型手機。

比較PowerShell 2.0 新功能很棒的Blog

值得參考

http://www.jonathanmedd.net/category/cmdlet-series

查詢 PowerShell 版本

PS C:\> Get-Host


Name : ConsoleHost
Version : 2.0
InstanceId : 9c0bcffb-f780-402f-b4ab-696e29a34f67
UI : System.Management.Automation.Internal.Host.InternalHostUserI
nterface
CurrentCulture : zh-TW
CurrentUICulture : zh-TW
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace



PS C:\>

2010/07/07

PowerShell Array

宣告:

[array]$tmpary= @()

Add Array:

$tmpary+= "a"
$tmpary+= "b"
$tmpary+= "c"

Get Array:

if ($ary.Count -gt 0)
{
foreach ($element in $ary)
{
echo $element
}
}

Array Contains & Notcontains:

if ($tempary -contains "a")
{
echo "a exists."
}

if ($tempary -notcontains "d")
{
echo "d not exists."
}

90% 症候群