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'。如果你只是在等待,背景工作是浪费。 –