2011-07-08 6 views
2

私はpowershellを初めて使用しています。私はそれを試しています。powershellに2行追加する

PS C:\PowerShell> New-Item C:\PowerShell\test.ps1 -type file -force -value "Ping jay" 

は、私はそれがgoogle.com

+0

はそれを手に入れました。新しいアイテムC:\ PowerShell \ test.ps1タイプファイル-force -value "ping google.com" – user770022

+0

追加コンテンツC:\ PowerShell \ test.ps1 "nPing jay" – user770022

答えて

3
"ping google.com" | add-content C:\PowerShell\test.ps1 
0
にpingを実行したい、それが完了した後にPCはその後、ここにある、それはジェイにpingを実行するスクリプトを実行すると、pingを下回るジェイ をping google.comを追加します

セミコロンは、PowerShellのラインセパレーターです:

New-Item C:\PowerShell\test.ps1 -type file -force -value "Ping jay ; Ping google.com"

関連する問題