Avatar of PaulRKrueger
PaulRKrueger

asked on 

Powershell list evaluation

I'm working on a PowerShell script that queries our BackupExec database for the most recent completed jobs with "TM2ID" in the name and then uses the data from that query to send a status update through another script. Current code looks like this:

get-bejobhistory -fromstarttime (get-date).addminutes(-60) | where-object {$_.Name -like '*TM2ID*'} 

Open in new window


and the result I get is this:

Name                            JobStatus JobType StartTime             EndTime              
----                            --------- ------- ---------             -------              
Backup 00283-Full (TM2ID:33)    Succeeded Backup  11/19/2014 9:02:54 AM 11/19/2014 9:04:22 AM
Backup 00284-Full (TM2ID:133)   Canceled  Backup  11/19/2014 9:08:22 AM 11/19/2014 9:09:49 AM
Backup 00285-Full (TM2ID:4233)  Failed    Backup  11/19/2014 9:12:36 AM 11/19/2014 9:14:04 AM

Open in new window


What I need to do with each item found is put the number following "TM2ID:" into one variable and the JobStatus into another variable, and then do stuff with those variables (I think I've got that part figured out).
PowershellScripting Languages

Avatar of undefined
Last Comment
Rajitha Chimmani
SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Scripting Languages
Scripting Languages

A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.

30K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo