0
我想在後臺運行一個函數Get_List,當它運行時,屏幕應該顯示「正在搜索信息」+點,使其看起來像工作正在完成。使用Powershell在後臺運行函數
function Get_List {
#Some basic command to run in the background
}
。
function Other{
#start the Get_List function in background
while(Get-Job -State "Running")
{
#show "Searching for Information"
#no need to code this part for me
}
}
我見過很多有類似問題的人,但我的(我認爲)有點不同。沒有參數被傳遞,我只是想在背景上運行一些東西,大約需要5-10秒,完成後就是這樣。
我想盡可能簡單。任何幫助表示讚賞。
那麼,你的問題是什麼,你有什麼試過,你得到了什麼錯誤? – TheMadTechnician
爲什麼?如果您確實需要反饋,請在'get_list'中使用'write-progress'。如果你只是在等待,背景工作是浪費。 –