2011-07-08 41 views
2

我是powershell的新手,我正在玩弄它。在powershell中添加第二行

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

我想補充平安google.com低於平傑 當我運行ping命令周杰倫的腳本爲PC這裏,那麼它完成後,我希望它來ping google.com

+0

明白了。新項目C:\ PowerShell \ test.ps1 -type文件-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

分號是在PowerShell中的行分隔符:

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

相關問題