Power Shell background tasks

Start background tasks
For example, perform ping 114.114.114.114 in the background

Start-Job -ScriptBlock {ping 114.114.114.114}

From the return, you can see the basic information of the job

Id     Name            PSJobTypeName   State         HasMoreData     Location             Command                  
--     ----            -------------   -----         -----------     --------             -------                  
1      Job1            BackgroundJob   Running       True            localhost            ping 114.114.114.114 

In addition to Start-Job, there are commands that can perform tasks remotely, Invoke-Command

View background tasks

Get-Job

The result is as follows

Id     Name            PSJobTypeName   State         HasMoreData     Location             Command                  
--     ----            -------------   -----         -----------     --------             -------                             
1      Job1            BackgroundJob   Completed     True            localhost            ping 114.114.114.114
3      Job3            BackgroundJob   Running       True            localhost            Sleep -Seconds 10 

Stop background tasks

Stop-Job -Id 1

Remove background tasks

Remove-Job -Id 1

other

Chia script

new-item -path $env:userprofile\.chia\mainnet\ -name plotter -type directory
Start-Job -ScriptBlock {
cd "$ENV:LOCALAPPDATA\chia-blockchain\app-1.1.6\resources\app.asar.unpacked\daemon\"
.\chia plots create -n 99 -r 4 -b 3390 -u 64 -f b2d36be2a6c0xxxxxxxxxxxxxxx8fef70dc11244 -p a4ab1376bcded8xxxxxxxxxxxxxxxab11cdeb24bf494 -t "D:\" -d "Z:\01" | tee -filepath $env:userprofile\.chia\mainnet\plotter\plots-5-21-2021-D1.txt
}

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇