Hello,
I'm having difficulties setting up a custom script and was wondering, would anyone know how could I achieve below with one script?
Disable backup job.
Display status of this running job and keep updating its status every 15 seconds in powershell window
when backup finished or status changed to stopped, run another powershell script.
Thanks
-
- Novice
- Posts: 3
- Liked: never
- Joined: Mar 04, 2016 12:52 pm
- Contact:
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Script help
1) Check this cmdlet.
2), 3) Try this:
Thanks.
2), 3) Try this:
Code: Select all
$Job = Get-VBRJob -Name "Name of your job"
do {
$Job.FindLastSession().State
Start-Sleep -Seconds 15
} while ($Job.FindLastSession().State -ne "Stopped")
#Your next command
-
- Novice
- Posts: 3
- Liked: never
- Joined: Mar 04, 2016 12:52 pm
- Contact:
Re: Script help
Thanks, that all worked, but I think argument was suppose to be "-ne" rather than "-eq"
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Script help
You're right indeed. Sometimes that happens when you're posting scripts created for testing purposes.
Updated the code already.
Updated the code already.
Who is online
Users browsing this forum: No registered users and 23 guests