- Jan 21 Sun 2007 01:37
PowerShell:Windows PowerShell in Practice
- Jan 20 Sat 2007 09:53
Windows Management Instrumentation Tester
- Jan 20 Sat 2007 09:12
PowerShell:Managing Processes in PowerShell 重點整理
Managing Processes in PowerShell 重點整理
- 在PowerShell的環境中
- 若執行process是win32 process且為背景執行
則PowerShell會立即出現下一個命令的提示,而不會等此process結束才出現 - 例如notepad.exe
- 若執行process是console application且為背景執行
則PowerShell不會立即出現下一個命令的提示,而會等此process結束才出現 - 例如ping.exe
- 在cmd.exe的環境中
- start/wait win32 process 則不會立即出現下一個命令的提示,而會等此process結束才出現
- 若欲在PowerShell的環境中達到類似的效果
- 第一種:可以將指令pipe給out-null
- 例如notepad | out-null
- 第二種:$np = get-process 某ProcessName
$np.waitforexit()
- Jan 14 Sun 2007 08:13
PowerShell:看目前有哪些環境變數
- 使用以下指令
- PS C:\> cd env:
- PS Env:\> ls
- Path
TEMP
SESSIONNAME
PATHEXT
- Jan 14 Sun 2007 08:01
PowerShell:看目前PowerShell中有哪些變數
- 可以使用Get-Variable這個cmdlet取得目前的變數有哪些
- 或者使用以下指令
- PS C:\> cd variable:
PS Variable:\> ls
- Jan 14 Sun 2007 07:53
PowerShell:看有哪些Alias
- 可以使用Get-Alias這個cmdlet取得目前的Alias有哪些
- 或者使用以下指令
- PS C:\> cd alias:
PS Alias:\> ls
- Jan 07 Sun 2007 07:53
PowerShell:ConvertTo-Html
在PowerShell中
若想要將指令的結果存成網頁
則可以使用ConvertTo-Html這個cmdlet
- Jan 06 Sat 2007 09:39
2006 Bye Bye
(這篇不是PowerShell :))
終於到了2007年
回首去年一整年真的是五味雜陳
從穿上西裝到換成軍裝
- Jan 06 Sat 2007 08:09
PowerShell:將剪貼簿中的文字複製到檔案
前幾篇寫了有關將檔案內容複製到剪貼簿的函數
本篇為如何將剪貼簿中的文字複製到檔案
用處:
- Jan 06 Sat 2007 07:10
PowerShell:此path是資料夾還是檔案?
我們若欲得知某path是資料夾還是檔案
可用以下的方式判斷
- 判斷Path是資料夾
- Test-Path -pathtype Container 欲檢驗的Path
- 結果為True
- Test-Path -pathtype Leaf 欲檢驗的Path
- 結果為False
- (Get-Item 欲檢驗的Path).PSIsContainer
- 結果為True
- 判斷Path是檔案
- Test-Path -pathtype Container 欲檢驗的Path
- 結果為False
- Test-Path -pathtype Leaf 欲檢驗的Path
- 結果為True
- (Get-Item 欲檢驗的Path).PSIsContainer
- 結果為False