循环内的函数-powershell
如何在循环内调用函数?我正在尝试运行一个无限循环来运行一个函数。我有类似的东西循环内的函数-powershell,powershell,Powershell,如何在循环内调用函数?我正在尝试运行一个无限循环来运行一个函数。我有类似的东西 #Infinite loop to filter file while ($true){ #run this function filterFile } function filterFile{ #do filtering of files here } function anotherFunction{ #another function } 如果可能的话,我如何实现它,如果
#Infinite loop to filter file
while ($true){
#run this function
filterFile
}
function filterFile{
#do filtering of files here
}
function anotherFunction{
#another function
}
如果可能的话,我如何实现它,如果没有,还有其他方法吗?引用“MadTechnician”的答案。更改顺序将执行以下操作:
function filterFile{
#do filtering of files here
}
#Infinite loop to filter file
while ($true){
#run this function
filterFile
}
把你的函数移到循环之前,你应该会没事的。这很好。我想我想得太多了,忘了做这件事。谢谢!