0

I'm in the process of writing a powershell script that will mount a ShadowProtect Image via their mount.exe (while actually learning Powershell!).

My question is - while the mount.exe command runs in the background, can I get a % loop running which matches the running of the mount command? or is this not possible?

i.e. as the mount command mounts the image, Powershell will show it's progress in mounting, and once the mount is complete, display 100%, when it's half way, 50% etc?

My initial thought is that this isn't possible - since it would need to know what the mount.exe is doing to actually show a relative %, but I thought it's worth asking!

Thanks

PnP
  • 3,133
  • 17
  • 62
  • 95
  • 2
    unless mount.exe reports progress itself, it is not possible to have powershell show progress. your suspicions are correct. – x0n Nov 18 '12 at 15:32

1 Answers1

1

I guess it depends on how much control and information can you get from your mounting process, a good approach would be to implement a callback in your process, so that powershell can respond to that, this discussion can provide you with great help on how to achieve it: Provide a .NET method as a delegate callback

whenever you reach an important milestone, you can realease a callback indicating the kind of event or action that happened, and then display it to the user.

Community
  • 1
  • 1
Jorge Alvarado
  • 2,664
  • 22
  • 33