Wait for script execution

Hi

I have the following in my script.

My question is does the code below wait for bootstrap.ps1 to complete before removing the itself?

Will the bootstrap.ps1 continues to run if itself is deleted?

logit "Executing bootstrap.ps1 from ${basedir}\payload\"
& "${basedir}\load\bootstrap.ps1"  | tee-object -filepath ${log} -append

logit "Cleaning up"
Remove-Item -Confirm:$false ${basedir}\load -Recurse

July 31st, 2015 12:28am

Hi Kelly,

it ought to wait until the script is completed, however once a script is started and fully initialized, it won't care whether you change or remove the script file.

So either way, you're safe.

Cheers,
Fred

Free Windows Admin Tool Kit Click here and download it now
July 31st, 2015 2:56am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics